<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE CPP #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE LambdaCase #-}</span><span>
</span><span id="line-3"></span><span>
</span><span id="line-4"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-5"></span><span class="hs-comment">--</span><span>
</span><span id="line-6"></span><span class="hs-comment">-- Code generator utilities; mostly monadic</span><span>
</span><span id="line-7"></span><span class="hs-comment">--</span><span>
</span><span id="line-8"></span><span class="hs-comment">-- (c) The University of Glasgow 2004-2006</span><span>
</span><span id="line-9"></span><span class="hs-comment">--</span><span>
</span><span id="line-10"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-11"></span><span>
</span><span id="line-12"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.StgToCmm.Utils</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-13"></span><span>        </span><span class="annot"><a href="GHC.StgToCmm.Utils.html#cgLit"><span class="hs-identifier">cgLit</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Utils.html#mkSimpleLit"><span class="hs-identifier">mkSimpleLit</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-14"></span><span>        </span><span class="annot"><a href="GHC.StgToCmm.Utils.html#emitDataLits"><span class="hs-identifier">emitDataLits</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Utils.html#emitRODataLits"><span class="hs-identifier">emitRODataLits</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-15"></span><span>        </span><span class="annot"><a href="GHC.StgToCmm.Utils.html#emitDataCon"><span class="hs-identifier">emitDataCon</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-16"></span><span>        </span><span class="annot"><a href="GHC.StgToCmm.Utils.html#emitRtsCall"><span class="hs-identifier">emitRtsCall</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Utils.html#emitRtsCallWithResult"><span class="hs-identifier">emitRtsCallWithResult</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Utils.html#emitRtsCallGen"><span class="hs-identifier">emitRtsCallGen</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-17"></span><span>        </span><span class="annot"><a href="GHC.StgToCmm.Utils.html#assignTemp"><span class="hs-identifier">assignTemp</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Utils.html#newTemp"><span class="hs-identifier">newTemp</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-18"></span><span>
</span><span id="line-19"></span><span>        </span><span class="annot"><a href="GHC.StgToCmm.Utils.html#newUnboxedTupleRegs"><span class="hs-identifier">newUnboxedTupleRegs</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-20"></span><span>
</span><span id="line-21"></span><span>        </span><span class="annot"><a href="GHC.StgToCmm.Utils.html#emitMultiAssign"><span class="hs-identifier">emitMultiAssign</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Utils.html#emitCmmLitSwitch"><span class="hs-identifier">emitCmmLitSwitch</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Utils.html#emitSwitch"><span class="hs-identifier">emitSwitch</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-22"></span><span>
</span><span id="line-23"></span><span>        </span><span class="annot"><a href="GHC.StgToCmm.Utils.html#tagToClosure"><span class="hs-identifier">tagToClosure</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Utils.html#mkTaggedObjectLoad"><span class="hs-identifier">mkTaggedObjectLoad</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-24"></span><span>
</span><span id="line-25"></span><span>        </span><span class="annot"><a href="GHC.Platform.Regs.html#callerSaves"><span class="hs-identifier">callerSaves</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Utils.html#callerSaveVolatileRegs"><span class="hs-identifier">callerSaveVolatileRegs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.CgUtils.html#get_GlobalReg_addr"><span class="hs-identifier">get_GlobalReg_addr</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-26"></span><span>        </span><span class="annot"><a href="GHC.StgToCmm.Utils.html#callerSaveGlobalReg"><span class="hs-identifier">callerSaveGlobalReg</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Utils.html#callerRestoreGlobalReg"><span class="hs-identifier">callerRestoreGlobalReg</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-27"></span><span>
</span><span id="line-28"></span><span>        </span><span class="annot"><a href="GHC.Cmm.Utils.html#cmmAndWord"><span class="hs-identifier">cmmAndWord</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Utils.html#cmmOrWord"><span class="hs-identifier">cmmOrWord</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Utils.html#cmmNegate"><span class="hs-identifier">cmmNegate</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Utils.html#cmmEqWord"><span class="hs-identifier">cmmEqWord</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Utils.html#cmmNeWord"><span class="hs-identifier">cmmNeWord</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-29"></span><span>        </span><span class="annot"><a href="GHC.Cmm.Utils.html#cmmUGtWord"><span class="hs-identifier">cmmUGtWord</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Utils.html#cmmSubWord"><span class="hs-identifier">cmmSubWord</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Utils.html#cmmMulWord"><span class="hs-identifier">cmmMulWord</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Utils.html#cmmAddWord"><span class="hs-identifier">cmmAddWord</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Utils.html#cmmUShrWord"><span class="hs-identifier">cmmUShrWord</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-30"></span><span>        </span><span class="annot"><a href="GHC.Cmm.Utils.html#cmmOffsetExprW"><span class="hs-identifier">cmmOffsetExprW</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Utils.html#cmmOffsetExprB"><span class="hs-identifier">cmmOffsetExprB</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-31"></span><span>        </span><span class="annot"><a href="GHC.Cmm.Utils.html#cmmRegOffW"><span class="hs-identifier">cmmRegOffW</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Utils.html#cmmRegOffB"><span class="hs-identifier">cmmRegOffB</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-32"></span><span>        </span><span class="annot"><a href="GHC.Cmm.Utils.html#cmmLabelOffW"><span class="hs-identifier">cmmLabelOffW</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Utils.html#cmmLabelOffB"><span class="hs-identifier">cmmLabelOffB</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-33"></span><span>        </span><span class="annot"><a href="GHC.Cmm.Utils.html#cmmOffsetW"><span class="hs-identifier">cmmOffsetW</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Utils.html#cmmOffsetB"><span class="hs-identifier">cmmOffsetB</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-34"></span><span>        </span><span class="annot"><a href="GHC.Cmm.Utils.html#cmmOffsetLitW"><span class="hs-identifier">cmmOffsetLitW</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Utils.html#cmmOffsetLitB"><span class="hs-identifier">cmmOffsetLitB</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-35"></span><span>        </span><span class="annot"><a href="GHC.Cmm.Utils.html#cmmLoadIndexW"><span class="hs-identifier">cmmLoadIndexW</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-36"></span><span>        </span><span class="annot"><a href="GHC.Cmm.Utils.html#cmmConstrTag1"><span class="hs-identifier">cmmConstrTag1</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-37"></span><span>
</span><span id="line-38"></span><span>        </span><span class="annot"><a href="GHC.Cmm.Utils.html#cmmUntag"><span class="hs-identifier">cmmUntag</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Utils.html#cmmIsTagged"><span class="hs-identifier">cmmIsTagged</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-39"></span><span>
</span><span id="line-40"></span><span>        </span><span class="annot"><a href="GHC.StgToCmm.Utils.html#addToMem"><span class="hs-identifier">addToMem</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Utils.html#addToMemE"><span class="hs-identifier">addToMemE</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Utils.html#addToMemLblE"><span class="hs-identifier">addToMemLblE</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Utils.html#addToMemLbl"><span class="hs-identifier">addToMemLbl</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-41"></span><span>        </span><span class="annot"><a href="GHC.StgToCmm.Utils.html#newStringCLit"><span class="hs-identifier">newStringCLit</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Utils.html#newByteStringCLit"><span class="hs-identifier">newByteStringCLit</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-42"></span><span>
</span><span id="line-43"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Update remembered set operations</span></span><span>
</span><span id="line-44"></span><span>        </span><span class="annot"><a href="GHC.StgToCmm.Utils.html#whenUpdRemSetEnabled"><span class="hs-identifier">whenUpdRemSetEnabled</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-45"></span><span>        </span><span class="annot"><a href="GHC.StgToCmm.Utils.html#emitUpdRemSetPush"><span class="hs-identifier">emitUpdRemSetPush</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-46"></span><span>        </span><span class="annot"><a href="GHC.StgToCmm.Utils.html#emitUpdRemSetPushThunk"><span class="hs-identifier">emitUpdRemSetPushThunk</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-47"></span><span>  </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span class="hs-cpp">

#include &quot;HsVersions.h&quot;
</span><span>
</span><span id="line-51"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-52"></span><span>
</span><span id="line-53"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#"><span class="hs-identifier">GHC.Platform</span></a></span><span>
</span><span id="line-54"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html"><span class="hs-identifier">GHC.StgToCmm.Monad</span></a></span><span>
</span><span id="line-55"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Closure.html"><span class="hs-identifier">GHC.StgToCmm.Closure</span></a></span><span>
</span><span id="line-56"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.html"><span class="hs-identifier">GHC.Cmm</span></a></span><span>
</span><span id="line-57"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.BlockId.html"><span class="hs-identifier">GHC.Cmm.BlockId</span></a></span><span>
</span><span id="line-58"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.Graph.html"><span class="hs-identifier">GHC.Cmm.Graph</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">CmmGraph</span></span><span>
</span><span id="line-59"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Platform.Regs.html"><span class="hs-identifier">GHC.Platform.Regs</span></a></span><span>
</span><span id="line-60"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.CLabel.html"><span class="hs-identifier">GHC.Cmm.CLabel</span></a></span><span>
</span><span id="line-61"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.Utils.html"><span class="hs-identifier">GHC.Cmm.Utils</span></a></span><span>
</span><span id="line-62"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.Switch.html"><span class="hs-identifier">GHC.Cmm.Switch</span></a></span><span>
</span><span id="line-63"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.StgToCmm.CgUtils.html"><span class="hs-identifier">GHC.StgToCmm.CgUtils</span></a></span><span>
</span><span id="line-64"></span><span>
</span><span id="line-65"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.ForeignCall.html"><span class="hs-identifier">GHC.Types.ForeignCall</span></a></span><span>
</span><span id="line-66"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Id.Info.html"><span class="hs-identifier">GHC.Types.Id.Info</span></a></span><span>
</span><span id="line-67"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Type.html"><span class="hs-identifier">GHC.Core.Type</span></a></span><span>
</span><span id="line-68"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html"><span class="hs-identifier">GHC.Core.TyCon</span></a></span><span>
</span><span id="line-69"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Layout.html"><span class="hs-identifier">GHC.Runtime.Heap.Layout</span></a></span><span>
</span><span id="line-70"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Unit.html"><span class="hs-identifier">GHC.Unit</span></a></span><span>
</span><span id="line-71"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Literal.html"><span class="hs-identifier">GHC.Types.Literal</span></a></span><span>
</span><span id="line-72"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.Graph.Directed.html"><span class="hs-identifier">GHC.Data.Graph.Directed</span></a></span><span>
</span><span id="line-73"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Misc.html"><span class="hs-identifier">GHC.Utils.Misc</span></a></span><span>
</span><span id="line-74"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Unique.html"><span class="hs-identifier">GHC.Types.Unique</span></a></span><span>
</span><span id="line-75"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html"><span class="hs-identifier">GHC.Types.Unique.Supply</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.Supply.html#MonadUnique"><span class="hs-identifier">MonadUnique</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-76"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html"><span class="hs-identifier">GHC.Driver.Session</span></a></span><span>
</span><span id="line-77"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html"><span class="hs-identifier">GHC.Data.FastString</span></a></span><span>
</span><span id="line-78"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html"><span class="hs-identifier">GHC.Utils.Outputable</span></a></span><span>
</span><span id="line-79"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.RepType.html"><span class="hs-identifier">GHC.Types.RepType</span></a></span><span>
</span><span id="line-80"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.CostCentre.html"><span class="hs-identifier">GHC.Types.CostCentre</span></a></span><span>
</span><span id="line-81"></span><span>
</span><span id="line-82"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.html#"><span class="hs-identifier">Data.ByteString</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier">ByteString</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-83"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Char8.html#"><span class="hs-identifier">Data.ByteString.Char8</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">BS8</span></span><span>
</span><span id="line-84"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../containers/src/Data.Map.html#"><span class="hs-identifier">Data.Map</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">M</span></span><span>
</span><span id="line-85"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Char.html#"><span class="hs-identifier">Data.Char</span></a></span><span>
</span><span id="line-86"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.List.html#"><span class="hs-identifier">Data.List</span></a></span><span>
</span><span id="line-87"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Ord.html#"><span class="hs-identifier">Data.Ord</span></a></span><span>
</span><span id="line-88"></span><span>
</span><span id="line-89"></span><span>
</span><span id="line-90"></span><span class="hs-comment">-------------------------------------------------------------------------</span><span>
</span><span id="line-91"></span><span class="hs-comment">--</span><span>
</span><span id="line-92"></span><span class="hs-comment">--      Literals</span><span>
</span><span id="line-93"></span><span class="hs-comment">--</span><span>
</span><span id="line-94"></span><span class="hs-comment">-------------------------------------------------------------------------</span><span>
</span><span id="line-95"></span><span>
</span><span id="line-96"></span><span class="annot"><a href="GHC.StgToCmm.Utils.html#cgLit"><span class="hs-identifier hs-type">cgLit</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Literal.html#Literal"><span class="hs-identifier hs-type">Literal</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmLit"><span class="hs-identifier hs-type">CmmLit</span></a></span><span>
</span><span id="line-97"></span><span id="cgLit"><span class="annot"><span class="annottext">cgLit :: Literal -&gt; FCode CmmLit
</span><a href="GHC.StgToCmm.Utils.html#cgLit"><span class="hs-identifier hs-var hs-var">cgLit</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Literal.html#LitString"><span class="hs-identifier hs-type">LitString</span></a></span><span> </span><span id="local-6989586621681051137"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621681051137"><span class="hs-identifier hs-var">s</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; FCode CmmLit
</span><a href="GHC.StgToCmm.Utils.html#newByteStringCLit"><span class="hs-identifier hs-var">newByteStringCLit</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621681051137"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-98"></span><span> </span><span class="hs-comment">-- not unpackFS; we want the UTF-8 byte stream.</span><span>
</span><span id="line-99"></span><span class="annot"><a href="GHC.StgToCmm.Utils.html#cgLit"><span class="hs-identifier hs-var">cgLit</span></a></span><span> </span><span id="local-6989586621681051136"><span class="annot"><span class="annottext">Literal
</span><a href="#local-6989586621681051136"><span class="hs-identifier hs-var">other_lit</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621681051135"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681051135"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode Platform
</span><a href="GHC.StgToCmm.Monad.html#getPlatform"><span class="hs-identifier hs-var">getPlatform</span></a></span><span>
</span><span id="line-100"></span><span>                         </span><span class="annot"><span class="annottext">CmmLit -&gt; FCode CmmLit
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; Literal -&gt; CmmLit
</span><a href="GHC.StgToCmm.Utils.html#mkSimpleLit"><span class="hs-identifier hs-var">mkSimpleLit</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681051135"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">Literal
</span><a href="#local-6989586621681051136"><span class="hs-identifier hs-var">other_lit</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-101"></span><span>
</span><span id="line-102"></span><span class="annot"><a href="GHC.StgToCmm.Utils.html#mkSimpleLit"><span class="hs-identifier hs-type">mkSimpleLit</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#Platform"><span class="hs-identifier hs-type">Platform</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Literal.html#Literal"><span class="hs-identifier hs-type">Literal</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmLit"><span class="hs-identifier hs-type">CmmLit</span></a></span><span>
</span><span id="line-103"></span><span id="mkSimpleLit"><span class="annot"><span class="annottext">mkSimpleLit :: Platform -&gt; Literal -&gt; CmmLit
</span><a href="GHC.StgToCmm.Utils.html#mkSimpleLit"><span class="hs-identifier hs-var hs-var">mkSimpleLit</span></a></span></span><span> </span><span id="local-6989586621681051133"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681051133"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-glyph">\</span><span class="hs-glyph">case</span><span>
</span><span id="line-104"></span><span>   </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Literal.html#LitChar"><span class="hs-identifier hs-type">LitChar</span></a></span><span>   </span><span id="local-6989586621681051131"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621681051131"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">)</span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Width -&gt; CmmLit
</span><a href="GHC.Cmm.Expr.html#CmmInt"><span class="hs-identifier hs-var">CmmInt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Key -&gt; Integer
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Key
</span><a href="../../base/src/GHC.Base.html#ord"><span class="hs-identifier hs-var">ord</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621681051131"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-105"></span><span>                                          </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; Width
</span><a href="GHC.Cmm.Type.html#wordWidth"><span class="hs-identifier hs-var">wordWidth</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681051133"><span class="hs-identifier hs-var">platform</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-106"></span><span>   </span><span class="annot"><span class="annottext">Literal
</span><a href="GHC.Types.Literal.html#LitNullAddr"><span class="hs-identifier hs-var">LitNullAddr</span></a></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; CmmLit
</span><a href="GHC.Cmm.Utils.html#zeroCLit"><span class="hs-identifier hs-var">zeroCLit</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681051133"><span class="hs-identifier hs-var">platform</span></a></span><span>
</span><span id="line-107"></span><span>   </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Literal.html#LitNumber"><span class="hs-identifier hs-type">LitNumber</span></a></span><span> </span><span class="annot"><span class="annottext">LitNumType
</span><a href="GHC.Types.Literal.html#LitNumInt"><span class="hs-identifier hs-var">LitNumInt</span></a></span><span> </span><span id="local-6989586621681051123"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681051123"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">)</span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Width -&gt; CmmLit
</span><a href="GHC.Cmm.Expr.html#CmmInt"><span class="hs-identifier hs-var">CmmInt</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681051123"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; Width
</span><a href="GHC.Cmm.Type.html#wordWidth"><span class="hs-identifier hs-var">wordWidth</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681051133"><span class="hs-identifier hs-var">platform</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-108"></span><span>   </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Literal.html#LitNumber"><span class="hs-identifier hs-type">LitNumber</span></a></span><span> </span><span class="annot"><span class="annottext">LitNumType
</span><a href="GHC.Types.Literal.html#LitNumInt64"><span class="hs-identifier hs-var">LitNumInt64</span></a></span><span> </span><span id="local-6989586621681051121"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681051121"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">)</span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Width -&gt; CmmLit
</span><a href="GHC.Cmm.Expr.html#CmmInt"><span class="hs-identifier hs-var">CmmInt</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681051121"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Width
</span><a href="GHC.Cmm.Type.html#W64"><span class="hs-identifier hs-var">W64</span></a></span><span>
</span><span id="line-109"></span><span>   </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Literal.html#LitNumber"><span class="hs-identifier hs-type">LitNumber</span></a></span><span> </span><span class="annot"><span class="annottext">LitNumType
</span><a href="GHC.Types.Literal.html#LitNumWord"><span class="hs-identifier hs-var">LitNumWord</span></a></span><span> </span><span id="local-6989586621681051118"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681051118"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">)</span><span>     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Width -&gt; CmmLit
</span><a href="GHC.Cmm.Expr.html#CmmInt"><span class="hs-identifier hs-var">CmmInt</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681051118"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; Width
</span><a href="GHC.Cmm.Type.html#wordWidth"><span class="hs-identifier hs-var">wordWidth</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681051133"><span class="hs-identifier hs-var">platform</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-110"></span><span>   </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Literal.html#LitNumber"><span class="hs-identifier hs-type">LitNumber</span></a></span><span> </span><span class="annot"><span class="annottext">LitNumType
</span><a href="GHC.Types.Literal.html#LitNumWord64"><span class="hs-identifier hs-var">LitNumWord64</span></a></span><span> </span><span id="local-6989586621681051116"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681051116"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">)</span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Width -&gt; CmmLit
</span><a href="GHC.Cmm.Expr.html#CmmInt"><span class="hs-identifier hs-var">CmmInt</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681051116"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Width
</span><a href="GHC.Cmm.Type.html#W64"><span class="hs-identifier hs-var">W64</span></a></span><span>
</span><span id="line-111"></span><span>   </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Literal.html#LitFloat"><span class="hs-identifier hs-type">LitFloat</span></a></span><span> </span><span id="local-6989586621681051114"><span class="annot"><span class="annottext">Rational
</span><a href="#local-6989586621681051114"><span class="hs-identifier hs-var">r</span></a></span></span><span class="hs-special">)</span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Rational -&gt; Width -&gt; CmmLit
</span><a href="GHC.Cmm.Expr.html#CmmFloat"><span class="hs-identifier hs-var">CmmFloat</span></a></span><span> </span><span class="annot"><span class="annottext">Rational
</span><a href="#local-6989586621681051114"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">Width
</span><a href="GHC.Cmm.Type.html#W32"><span class="hs-identifier hs-var">W32</span></a></span><span>
</span><span id="line-112"></span><span>   </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Literal.html#LitDouble"><span class="hs-identifier hs-type">LitDouble</span></a></span><span> </span><span id="local-6989586621681051110"><span class="annot"><span class="annottext">Rational
</span><a href="#local-6989586621681051110"><span class="hs-identifier hs-var">r</span></a></span></span><span class="hs-special">)</span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Rational -&gt; Width -&gt; CmmLit
</span><a href="GHC.Cmm.Expr.html#CmmFloat"><span class="hs-identifier hs-var">CmmFloat</span></a></span><span> </span><span class="annot"><span class="annottext">Rational
</span><a href="#local-6989586621681051110"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">Width
</span><a href="GHC.Cmm.Type.html#W64"><span class="hs-identifier hs-var">W64</span></a></span><span>
</span><span id="line-113"></span><span>   </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Literal.html#LitLabel"><span class="hs-identifier hs-type">LitLabel</span></a></span><span> </span><span id="local-6989586621681051108"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681051108"><span class="hs-identifier hs-var">fs</span></a></span></span><span> </span><span id="local-6989586621681051107"><span class="annot"><span class="annottext">Maybe Key
</span><a href="#local-6989586621681051107"><span class="hs-identifier hs-var">ms</span></a></span></span><span> </span><span id="local-6989586621681051106"><span class="annot"><span class="annottext">FunctionOrData
</span><a href="#local-6989586621681051106"><span class="hs-identifier hs-var">fod</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-114"></span><span>     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-comment">-- TODO: Literal labels might not actually be in the current package...</span><span>
</span><span id="line-115"></span><span>            </span><span id="local-6989586621681051105"><span class="annot"><span class="annottext">labelSrc :: ForeignLabelSource
</span><a href="#local-6989586621681051105"><span class="hs-identifier hs-var hs-var">labelSrc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ForeignLabelSource
</span><a href="GHC.Cmm.CLabel.html#ForeignLabelInThisPackage"><span class="hs-identifier hs-var">ForeignLabelInThisPackage</span></a></span><span>
</span><span id="line-116"></span><span>        </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">CLabel -&gt; CmmLit
</span><a href="GHC.Cmm.Expr.html#CmmLabel"><span class="hs-identifier hs-var">CmmLabel</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FastString
-&gt; Maybe Key -&gt; ForeignLabelSource -&gt; FunctionOrData -&gt; CLabel
</span><a href="GHC.Cmm.CLabel.html#mkForeignLabel"><span class="hs-identifier hs-var">mkForeignLabel</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681051108"><span class="hs-identifier hs-var">fs</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Key
</span><a href="#local-6989586621681051107"><span class="hs-identifier hs-var">ms</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignLabelSource
</span><a href="#local-6989586621681051105"><span class="hs-identifier hs-var">labelSrc</span></a></span><span> </span><span class="annot"><span class="annottext">FunctionOrData
</span><a href="#local-6989586621681051106"><span class="hs-identifier hs-var">fod</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-117"></span><span>   </span><span class="hs-comment">-- NB: LitRubbish should have been lowered in &quot;CoreToStg&quot;</span><span>
</span><span id="line-118"></span><span>   </span><span id="local-6989586621681051101"><span class="annot"><span class="annottext">Literal
</span><a href="#local-6989586621681051101"><span class="hs-identifier hs-var">other</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; CmmLit
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;mkSimpleLit&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Literal -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Literal
</span><a href="#local-6989586621681051101"><span class="hs-identifier hs-var">other</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-119"></span><span>
</span><span id="line-120"></span><span class="hs-comment">--------------------------------------------------------------------------</span><span>
</span><span id="line-121"></span><span class="hs-comment">--</span><span>
</span><span id="line-122"></span><span class="hs-comment">-- Incrementing a memory location</span><span>
</span><span id="line-123"></span><span class="hs-comment">--</span><span>
</span><span id="line-124"></span><span class="hs-comment">--------------------------------------------------------------------------</span><span>
</span><span id="line-125"></span><span>
</span><span id="line-126"></span><span class="annot"><a href="GHC.StgToCmm.Utils.html#addToMemLbl"><span class="hs-identifier hs-type">addToMemLbl</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Type.html#CmmType"><span class="hs-identifier hs-type">CmmType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.CLabel.html#CLabel"><span class="hs-identifier hs-type">CLabel</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Graph.html#CmmAGraph"><span class="hs-identifier hs-type">CmmAGraph</span></a></span><span>
</span><span id="line-127"></span><span id="addToMemLbl"><span class="annot"><span class="annottext">addToMemLbl :: CmmType -&gt; CLabel -&gt; Key -&gt; CmmAGraph
</span><a href="GHC.StgToCmm.Utils.html#addToMemLbl"><span class="hs-identifier hs-var hs-var">addToMemLbl</span></a></span></span><span> </span><span id="local-6989586621681051098"><span class="annot"><span class="annottext">CmmType
</span><a href="#local-6989586621681051098"><span class="hs-identifier hs-var">rep</span></a></span></span><span> </span><span id="local-6989586621681051097"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681051097"><span class="hs-identifier hs-var">lbl</span></a></span></span><span> </span><span id="local-6989586621681051096"><span class="annot"><span class="annottext">Key
</span><a href="#local-6989586621681051096"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmType -&gt; CmmExpr -&gt; Key -&gt; CmmAGraph
</span><a href="GHC.StgToCmm.Utils.html#addToMem"><span class="hs-identifier hs-var">addToMem</span></a></span><span> </span><span class="annot"><span class="annottext">CmmType
</span><a href="#local-6989586621681051098"><span class="hs-identifier hs-var">rep</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmLit -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmLit"><span class="hs-identifier hs-var">CmmLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CLabel -&gt; CmmLit
</span><a href="GHC.Cmm.Expr.html#CmmLabel"><span class="hs-identifier hs-var">CmmLabel</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681051097"><span class="hs-identifier hs-var">lbl</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Key
</span><a href="#local-6989586621681051096"><span class="hs-identifier hs-var">n</span></a></span><span>
</span><span id="line-128"></span><span>
</span><span id="line-129"></span><span class="annot"><a href="GHC.StgToCmm.Utils.html#addToMemLblE"><span class="hs-identifier hs-type">addToMemLblE</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Type.html#CmmType"><span class="hs-identifier hs-type">CmmType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.CLabel.html#CLabel"><span class="hs-identifier hs-type">CLabel</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Graph.html#CmmAGraph"><span class="hs-identifier hs-type">CmmAGraph</span></a></span><span>
</span><span id="line-130"></span><span id="addToMemLblE"><span class="annot"><span class="annottext">addToMemLblE :: CmmType -&gt; CLabel -&gt; CmmExpr -&gt; CmmAGraph
</span><a href="GHC.StgToCmm.Utils.html#addToMemLblE"><span class="hs-identifier hs-var hs-var">addToMemLblE</span></a></span></span><span> </span><span id="local-6989586621681051094"><span class="annot"><span class="annottext">CmmType
</span><a href="#local-6989586621681051094"><span class="hs-identifier hs-var">rep</span></a></span></span><span> </span><span id="local-6989586621681051093"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681051093"><span class="hs-identifier hs-var">lbl</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmType -&gt; CmmExpr -&gt; CmmExpr -&gt; CmmAGraph
</span><a href="GHC.StgToCmm.Utils.html#addToMemE"><span class="hs-identifier hs-var">addToMemE</span></a></span><span> </span><span class="annot"><span class="annottext">CmmType
</span><a href="#local-6989586621681051094"><span class="hs-identifier hs-var">rep</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmLit -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmLit"><span class="hs-identifier hs-var">CmmLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CLabel -&gt; CmmLit
</span><a href="GHC.Cmm.Expr.html#CmmLabel"><span class="hs-identifier hs-var">CmmLabel</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681051093"><span class="hs-identifier hs-var">lbl</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-131"></span><span>
</span><span id="line-132"></span><span class="annot"><a href="GHC.StgToCmm.Utils.html#addToMem"><span class="hs-identifier hs-type">addToMem</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Type.html#CmmType"><span class="hs-identifier hs-type">CmmType</span></a></span><span>     </span><span class="hs-comment">-- rep of the counter</span><span>
</span><span id="line-133"></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span>     </span><span class="hs-comment">-- Address</span><span>
</span><span id="line-134"></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>         </span><span class="hs-comment">-- What to add (a word)</span><span>
</span><span id="line-135"></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Graph.html#CmmAGraph"><span class="hs-identifier hs-type">CmmAGraph</span></a></span><span>
</span><span id="line-136"></span><span id="addToMem"><span class="annot"><span class="annottext">addToMem :: CmmType -&gt; CmmExpr -&gt; Key -&gt; CmmAGraph
</span><a href="GHC.StgToCmm.Utils.html#addToMem"><span class="hs-identifier hs-var hs-var">addToMem</span></a></span></span><span> </span><span id="local-6989586621681051092"><span class="annot"><span class="annottext">CmmType
</span><a href="#local-6989586621681051092"><span class="hs-identifier hs-var">rep</span></a></span></span><span> </span><span id="local-6989586621681051091"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681051091"><span class="hs-identifier hs-var">ptr</span></a></span></span><span> </span><span id="local-6989586621681051090"><span class="annot"><span class="annottext">Key
</span><a href="#local-6989586621681051090"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmType -&gt; CmmExpr -&gt; CmmExpr -&gt; CmmAGraph
</span><a href="GHC.StgToCmm.Utils.html#addToMemE"><span class="hs-identifier hs-var">addToMemE</span></a></span><span> </span><span class="annot"><span class="annottext">CmmType
</span><a href="#local-6989586621681051092"><span class="hs-identifier hs-var">rep</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681051091"><span class="hs-identifier hs-var">ptr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmLit -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmLit"><span class="hs-identifier hs-var">CmmLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; Width -&gt; CmmLit
</span><a href="GHC.Cmm.Expr.html#CmmInt"><span class="hs-identifier hs-var">CmmInt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Key -&gt; Integer
forall a. Integral a =&gt; a -&gt; Integer
</span><a href="../../base/src/GHC.Real.html#toInteger"><span class="hs-identifier hs-var">toInteger</span></a></span><span> </span><span class="annot"><span class="annottext">Key
</span><a href="#local-6989586621681051090"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmType -&gt; Width
</span><a href="GHC.Cmm.Type.html#typeWidth"><span class="hs-identifier hs-var">typeWidth</span></a></span><span> </span><span class="annot"><span class="annottext">CmmType
</span><a href="#local-6989586621681051092"><span class="hs-identifier hs-var">rep</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-137"></span><span>
</span><span id="line-138"></span><span class="annot"><a href="GHC.StgToCmm.Utils.html#addToMemE"><span class="hs-identifier hs-type">addToMemE</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Type.html#CmmType"><span class="hs-identifier hs-type">CmmType</span></a></span><span>    </span><span class="hs-comment">-- rep of the counter</span><span>
</span><span id="line-139"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span>    </span><span class="hs-comment">-- Address</span><span>
</span><span id="line-140"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span>    </span><span class="hs-comment">-- What to add (a word-typed expression)</span><span>
</span><span id="line-141"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Graph.html#CmmAGraph"><span class="hs-identifier hs-type">CmmAGraph</span></a></span><span>
</span><span id="line-142"></span><span id="addToMemE"><span class="annot"><span class="annottext">addToMemE :: CmmType -&gt; CmmExpr -&gt; CmmExpr -&gt; CmmAGraph
</span><a href="GHC.StgToCmm.Utils.html#addToMemE"><span class="hs-identifier hs-var hs-var">addToMemE</span></a></span></span><span> </span><span id="local-6989586621681051088"><span class="annot"><span class="annottext">CmmType
</span><a href="#local-6989586621681051088"><span class="hs-identifier hs-var">rep</span></a></span></span><span> </span><span id="local-6989586621681051087"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681051087"><span class="hs-identifier hs-var">ptr</span></a></span></span><span> </span><span id="local-6989586621681051086"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681051086"><span class="hs-identifier hs-var">n</span></a></span></span><span>
</span><span id="line-143"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmExpr -&gt; CmmExpr -&gt; CmmAGraph
</span><a href="GHC.Cmm.Graph.html#mkStore"><span class="hs-identifier hs-var">mkStore</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681051087"><span class="hs-identifier hs-var">ptr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">MachOp -&gt; [CmmExpr] -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmMachOp"><span class="hs-identifier hs-var">CmmMachOp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Width -&gt; MachOp
</span><a href="GHC.Cmm.MachOp.html#MO_Add"><span class="hs-identifier hs-var">MO_Add</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmType -&gt; Width
</span><a href="GHC.Cmm.Type.html#typeWidth"><span class="hs-identifier hs-var">typeWidth</span></a></span><span> </span><span class="annot"><span class="annottext">CmmType
</span><a href="#local-6989586621681051088"><span class="hs-identifier hs-var">rep</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">CmmExpr -&gt; CmmType -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmLoad"><span class="hs-identifier hs-var">CmmLoad</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681051087"><span class="hs-identifier hs-var">ptr</span></a></span><span> </span><span class="annot"><span class="annottext">CmmType
</span><a href="#local-6989586621681051088"><span class="hs-identifier hs-var">rep</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681051086"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-144"></span><span>
</span><span id="line-145"></span><span>
</span><span id="line-146"></span><span class="hs-comment">-------------------------------------------------------------------------</span><span>
</span><span id="line-147"></span><span class="hs-comment">--</span><span>
</span><span id="line-148"></span><span class="hs-comment">--      Loading a field from an object,</span><span>
</span><span id="line-149"></span><span class="hs-comment">--      where the object pointer is itself tagged</span><span>
</span><span id="line-150"></span><span class="hs-comment">--</span><span>
</span><span id="line-151"></span><span class="hs-comment">-------------------------------------------------------------------------</span><span>
</span><span id="line-152"></span><span>
</span><span id="line-153"></span><span class="annot"><a href="GHC.StgToCmm.Utils.html#mkTaggedObjectLoad"><span class="hs-identifier hs-type">mkTaggedObjectLoad</span></a></span><span>
</span><span id="line-154"></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#Platform"><span class="hs-identifier hs-type">Platform</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#LocalReg"><span class="hs-identifier hs-type">LocalReg</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#LocalReg"><span class="hs-identifier hs-type">LocalReg</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Layout.html#ByteOff"><span class="hs-identifier hs-type">ByteOff</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Closure.html#DynTag"><span class="hs-identifier hs-type">DynTag</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Graph.html#CmmAGraph"><span class="hs-identifier hs-type">CmmAGraph</span></a></span><span>
</span><span id="line-155"></span><span class="hs-comment">-- (loadTaggedObjectField reg base off tag) generates assignment</span><span>
</span><span id="line-156"></span><span class="hs-comment">--      reg = bitsK[ base + off - tag ]</span><span>
</span><span id="line-157"></span><span class="hs-comment">-- where K is fixed by 'reg'</span><span>
</span><span id="line-158"></span><span id="mkTaggedObjectLoad"><span class="annot"><span class="annottext">mkTaggedObjectLoad :: Platform -&gt; LocalReg -&gt; LocalReg -&gt; Key -&gt; Key -&gt; CmmAGraph
</span><a href="GHC.StgToCmm.Utils.html#mkTaggedObjectLoad"><span class="hs-identifier hs-var hs-var">mkTaggedObjectLoad</span></a></span></span><span> </span><span id="local-6989586621681051079"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681051079"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span id="local-6989586621681051078"><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681051078"><span class="hs-identifier hs-var">reg</span></a></span></span><span> </span><span id="local-6989586621681051077"><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681051077"><span class="hs-identifier hs-var">base</span></a></span></span><span> </span><span id="local-6989586621681051076"><span class="annot"><span class="annottext">Key
</span><a href="#local-6989586621681051076"><span class="hs-identifier hs-var">offset</span></a></span></span><span> </span><span id="local-6989586621681051075"><span class="annot"><span class="annottext">Key
</span><a href="#local-6989586621681051075"><span class="hs-identifier hs-var">tag</span></a></span></span><span>
</span><span id="line-159"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmReg -&gt; CmmExpr -&gt; CmmAGraph
</span><a href="GHC.Cmm.Graph.html#mkAssign"><span class="hs-identifier hs-var">mkAssign</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LocalReg -&gt; CmmReg
</span><a href="GHC.Cmm.Expr.html#CmmLocal"><span class="hs-identifier hs-var">CmmLocal</span></a></span><span> </span><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681051078"><span class="hs-identifier hs-var">reg</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-160"></span><span>             </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmExpr -&gt; CmmType -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmLoad"><span class="hs-identifier hs-var">CmmLoad</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; CmmExpr -&gt; Key -&gt; CmmExpr
</span><a href="GHC.Cmm.Utils.html#cmmOffsetB"><span class="hs-identifier hs-var">cmmOffsetB</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681051079"><span class="hs-identifier hs-var">platform</span></a></span><span>
</span><span id="line-161"></span><span>                                  </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmReg -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmReg"><span class="hs-identifier hs-var">CmmReg</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LocalReg -&gt; CmmReg
</span><a href="GHC.Cmm.Expr.html#CmmLocal"><span class="hs-identifier hs-var">CmmLocal</span></a></span><span> </span><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681051077"><span class="hs-identifier hs-var">base</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-162"></span><span>                                  </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Key
</span><a href="#local-6989586621681051076"><span class="hs-identifier hs-var">offset</span></a></span><span> </span><span class="annot"><span class="annottext">Key -&gt; Key -&gt; Key
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Key
</span><a href="#local-6989586621681051075"><span class="hs-identifier hs-var">tag</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-163"></span><span>                      </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LocalReg -&gt; CmmType
</span><a href="GHC.Cmm.Expr.html#localRegType"><span class="hs-identifier hs-var">localRegType</span></a></span><span> </span><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681051078"><span class="hs-identifier hs-var">reg</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-164"></span><span>
</span><span id="line-165"></span><span class="hs-comment">-------------------------------------------------------------------------</span><span>
</span><span id="line-166"></span><span class="hs-comment">--</span><span>
</span><span id="line-167"></span><span class="hs-comment">--      Converting a closure tag to a closure for enumeration types</span><span>
</span><span id="line-168"></span><span class="hs-comment">--      (this is the implementation of tagToEnum#).</span><span>
</span><span id="line-169"></span><span class="hs-comment">--</span><span>
</span><span id="line-170"></span><span class="hs-comment">-------------------------------------------------------------------------</span><span>
</span><span id="line-171"></span><span>
</span><span id="line-172"></span><span class="annot"><a href="GHC.StgToCmm.Utils.html#tagToClosure"><span class="hs-identifier hs-type">tagToClosure</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#Platform"><span class="hs-identifier hs-type">Platform</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span>
</span><span id="line-173"></span><span id="tagToClosure"><span class="annot"><span class="annottext">tagToClosure :: Platform -&gt; TyCon -&gt; CmmExpr -&gt; CmmExpr
</span><a href="GHC.StgToCmm.Utils.html#tagToClosure"><span class="hs-identifier hs-var hs-var">tagToClosure</span></a></span></span><span> </span><span id="local-6989586621681051070"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681051070"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span id="local-6989586621681051069"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681051069"><span class="hs-identifier hs-var">tycon</span></a></span></span><span> </span><span id="local-6989586621681051068"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681051068"><span class="hs-identifier hs-var">tag</span></a></span></span><span>
</span><span id="line-174"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmExpr -&gt; CmmType -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmLoad"><span class="hs-identifier hs-var">CmmLoad</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; CmmExpr -&gt; CmmExpr -&gt; CmmExpr
</span><a href="GHC.Cmm.Utils.html#cmmOffsetExprW"><span class="hs-identifier hs-var">cmmOffsetExprW</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681051070"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681051067"><span class="hs-identifier hs-var">closure_tbl</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681051068"><span class="hs-identifier hs-var">tag</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; CmmType
</span><a href="GHC.Cmm.Type.html#bWord"><span class="hs-identifier hs-var">bWord</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681051070"><span class="hs-identifier hs-var">platform</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-175"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621681051067"><span class="annot"><span class="annottext">closure_tbl :: CmmExpr
</span><a href="#local-6989586621681051067"><span class="hs-identifier hs-var hs-var">closure_tbl</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmLit -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmLit"><span class="hs-identifier hs-var">CmmLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CLabel -&gt; CmmLit
</span><a href="GHC.Cmm.Expr.html#CmmLabel"><span class="hs-identifier hs-var">CmmLabel</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681051065"><span class="hs-identifier hs-var">lbl</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-176"></span><span>        </span><span id="local-6989586621681051065"><span class="annot"><span class="annottext">lbl :: CLabel
</span><a href="#local-6989586621681051065"><span class="hs-identifier hs-var hs-var">lbl</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; CafInfo -&gt; CLabel
</span><a href="GHC.Cmm.CLabel.html#mkClosureTableLabel"><span class="hs-identifier hs-var">mkClosureTableLabel</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCon -&gt; Name
</span><a href="GHC.Core.TyCon.html#tyConName"><span class="hs-identifier hs-var hs-var">tyConName</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681051069"><span class="hs-identifier hs-var">tycon</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CafInfo
</span><a href="GHC.Types.Id.Info.html#NoCafRefs"><span class="hs-identifier hs-var">NoCafRefs</span></a></span><span>
</span><span id="line-177"></span><span>
</span><span id="line-178"></span><span class="hs-comment">-------------------------------------------------------------------------</span><span>
</span><span id="line-179"></span><span class="hs-comment">--</span><span>
</span><span id="line-180"></span><span class="hs-comment">--      Conditionals and rts calls</span><span>
</span><span id="line-181"></span><span class="hs-comment">--</span><span>
</span><span id="line-182"></span><span class="hs-comment">-------------------------------------------------------------------------</span><span>
</span><span id="line-183"></span><span>
</span><span id="line-184"></span><span class="annot"><a href="GHC.StgToCmm.Utils.html#emitRtsCall"><span class="hs-identifier hs-type">emitRtsCall</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#UnitId"><span class="hs-identifier hs-type">UnitId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.Cmm.Type.html#ForeignHint"><span class="hs-identifier hs-type">ForeignHint</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-185"></span><span id="emitRtsCall"><span class="annot"><span class="annottext">emitRtsCall :: UnitId
-&gt; FastString -&gt; [(CmmExpr, ForeignHint)] -&gt; Bool -&gt; FCode ()
</span><a href="GHC.StgToCmm.Utils.html#emitRtsCall"><span class="hs-identifier hs-var hs-var">emitRtsCall</span></a></span></span><span> </span><span id="local-6989586621681051061"><span class="annot"><span class="annottext">UnitId
</span><a href="#local-6989586621681051061"><span class="hs-identifier hs-var">pkg</span></a></span></span><span> </span><span id="local-6989586621681051060"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681051060"><span class="hs-identifier hs-var">fun</span></a></span></span><span> </span><span id="local-6989586621681051059"><span class="annot"><span class="annottext">[(CmmExpr, ForeignHint)]
</span><a href="#local-6989586621681051059"><span class="hs-identifier hs-var">args</span></a></span></span><span> </span><span id="local-6989586621681051058"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681051058"><span class="hs-keyword hs-var">safe</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(LocalReg, ForeignHint)]
-&gt; CLabel -&gt; [(CmmExpr, ForeignHint)] -&gt; Bool -&gt; FCode ()
</span><a href="GHC.StgToCmm.Utils.html#emitRtsCallGen"><span class="hs-identifier hs-var">emitRtsCallGen</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnitId -&gt; FastString -&gt; CLabel
</span><a href="GHC.Cmm.CLabel.html#mkCmmCodeLabel"><span class="hs-identifier hs-var">mkCmmCodeLabel</span></a></span><span> </span><span class="annot"><span class="annottext">UnitId
</span><a href="#local-6989586621681051061"><span class="hs-identifier hs-var">pkg</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681051060"><span class="hs-identifier hs-var">fun</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[(CmmExpr, ForeignHint)]
</span><a href="#local-6989586621681051059"><span class="hs-identifier hs-var">args</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681051058"><span class="hs-keyword hs-var">safe</span></a></span><span>
</span><span id="line-186"></span><span>
</span><span id="line-187"></span><span class="annot"><a href="GHC.StgToCmm.Utils.html#emitRtsCallWithResult"><span class="hs-identifier hs-type">emitRtsCallWithResult</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#LocalReg"><span class="hs-identifier hs-type">LocalReg</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Type.html#ForeignHint"><span class="hs-identifier hs-type">ForeignHint</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#UnitId"><span class="hs-identifier hs-type">UnitId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span>
</span><span id="line-188"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.Cmm.Type.html#ForeignHint"><span class="hs-identifier hs-type">ForeignHint</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-189"></span><span id="emitRtsCallWithResult"><span class="annot"><span class="annottext">emitRtsCallWithResult :: LocalReg
-&gt; ForeignHint
-&gt; UnitId
-&gt; FastString
-&gt; [(CmmExpr, ForeignHint)]
-&gt; Bool
-&gt; FCode ()
</span><a href="GHC.StgToCmm.Utils.html#emitRtsCallWithResult"><span class="hs-identifier hs-var hs-var">emitRtsCallWithResult</span></a></span></span><span> </span><span id="local-6989586621681051056"><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681051056"><span class="hs-identifier hs-var">res</span></a></span></span><span> </span><span id="local-6989586621681051055"><span class="annot"><span class="annottext">ForeignHint
</span><a href="#local-6989586621681051055"><span class="hs-identifier hs-var">hint</span></a></span></span><span> </span><span id="local-6989586621681051054"><span class="annot"><span class="annottext">UnitId
</span><a href="#local-6989586621681051054"><span class="hs-identifier hs-var">pkg</span></a></span></span><span> </span><span id="local-6989586621681051053"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681051053"><span class="hs-identifier hs-var">fun</span></a></span></span><span> </span><span id="local-6989586621681051052"><span class="annot"><span class="annottext">[(CmmExpr, ForeignHint)]
</span><a href="#local-6989586621681051052"><span class="hs-identifier hs-var">args</span></a></span></span><span> </span><span id="local-6989586621681051051"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681051051"><span class="hs-keyword hs-var">safe</span></a></span></span><span>
</span><span id="line-190"></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(LocalReg, ForeignHint)]
-&gt; CLabel -&gt; [(CmmExpr, ForeignHint)] -&gt; Bool -&gt; FCode ()
</span><a href="GHC.StgToCmm.Utils.html#emitRtsCallGen"><span class="hs-identifier hs-var">emitRtsCallGen</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681051056"><span class="hs-identifier hs-var">res</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">ForeignHint
</span><a href="#local-6989586621681051055"><span class="hs-identifier hs-var">hint</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnitId -&gt; FastString -&gt; CLabel
</span><a href="GHC.Cmm.CLabel.html#mkCmmCodeLabel"><span class="hs-identifier hs-var">mkCmmCodeLabel</span></a></span><span> </span><span class="annot"><span class="annottext">UnitId
</span><a href="#local-6989586621681051054"><span class="hs-identifier hs-var">pkg</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681051053"><span class="hs-identifier hs-var">fun</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[(CmmExpr, ForeignHint)]
</span><a href="#local-6989586621681051052"><span class="hs-identifier hs-var">args</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681051051"><span class="hs-keyword hs-var">safe</span></a></span><span>
</span><span id="line-191"></span><span>
</span><span id="line-192"></span><span class="hs-comment">-- Make a call to an RTS C procedure</span><span>
</span><span id="line-193"></span><span class="annot"><a href="GHC.StgToCmm.Utils.html#emitRtsCallGen"><span class="hs-identifier hs-type">emitRtsCallGen</span></a></span><span>
</span><span id="line-194"></span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#LocalReg"><span class="hs-identifier hs-type">LocalReg</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.Cmm.Type.html#ForeignHint"><span class="hs-identifier hs-type">ForeignHint</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-195"></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.CLabel.html#CLabel"><span class="hs-identifier hs-type">CLabel</span></a></span><span>
</span><span id="line-196"></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.Cmm.Type.html#ForeignHint"><span class="hs-identifier hs-type">ForeignHint</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-197"></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-comment">-- True &lt;=&gt; CmmSafe call</span><span>
</span><span id="line-198"></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-199"></span><span id="emitRtsCallGen"><span class="annot"><span class="annottext">emitRtsCallGen :: [(LocalReg, ForeignHint)]
-&gt; CLabel -&gt; [(CmmExpr, ForeignHint)] -&gt; Bool -&gt; FCode ()
</span><a href="GHC.StgToCmm.Utils.html#emitRtsCallGen"><span class="hs-identifier hs-var hs-var">emitRtsCallGen</span></a></span></span><span> </span><span id="local-6989586621681051050"><span class="annot"><span class="annottext">[(LocalReg, ForeignHint)]
</span><a href="#local-6989586621681051050"><span class="hs-identifier hs-var">res</span></a></span></span><span> </span><span id="local-6989586621681051049"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681051049"><span class="hs-identifier hs-var">lbl</span></a></span></span><span> </span><span id="local-6989586621681051048"><span class="annot"><span class="annottext">[(CmmExpr, ForeignHint)]
</span><a href="#local-6989586621681051048"><span class="hs-identifier hs-var">args</span></a></span></span><span> </span><span id="local-6989586621681051047"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681051047"><span class="hs-keyword hs-var">safe</span></a></span></span><span>
</span><span id="line-200"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681051046"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681051046"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-201"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681051044"><span class="annot"><span class="annottext">Key
</span><a href="#local-6989586621681051044"><span class="hs-identifier hs-var">updfr_off</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode Key
</span><a href="GHC.StgToCmm.Monad.html#getUpdFrameOff"><span class="hs-identifier hs-var">getUpdFrameOff</span></a></span><span>
</span><span id="line-202"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681051042"><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681051042"><span class="hs-identifier hs-var">caller_save</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681051041"><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681051041"><span class="hs-identifier hs-var">caller_load</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; (CmmAGraph, CmmAGraph)
</span><a href="GHC.StgToCmm.Utils.html#callerSaveVolatileRegs"><span class="hs-identifier hs-var">callerSaveVolatileRegs</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681051046"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-203"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">CmmAGraph -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#emit"><span class="hs-identifier hs-var">emit</span></a></span><span> </span><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681051042"><span class="hs-identifier hs-var">caller_save</span></a></span><span>
</span><span id="line-204"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Key -&gt; FCode ()
</span><a href="#local-6989586621681051039"><span class="hs-identifier hs-var">call</span></a></span><span> </span><span class="annot"><span class="annottext">Key
</span><a href="#local-6989586621681051044"><span class="hs-identifier hs-var">updfr_off</span></a></span><span>
</span><span id="line-205"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">CmmAGraph -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#emit"><span class="hs-identifier hs-var">emit</span></a></span><span> </span><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681051041"><span class="hs-identifier hs-var">caller_load</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-206"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-207"></span><span>    </span><span id="local-6989586621681051039"><span class="annot"><span class="annottext">call :: Key -&gt; FCode ()
</span><a href="#local-6989586621681051039"><span class="hs-identifier hs-var hs-var">call</span></a></span></span><span> </span><span id="local-6989586621681051037"><span class="annot"><span class="annottext">Key
</span><a href="#local-6989586621681051037"><span class="hs-identifier hs-var">updfr_off</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-208"></span><span>      </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681051047"><span class="hs-keyword hs-var">safe</span></a></span><span> </span><span class="hs-keyword">then</span><span>
</span><span id="line-209"></span><span>        </span><span class="annot"><span class="annottext">CmmAGraph -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#emit"><span class="hs-identifier hs-var">emit</span></a></span><span> </span><span class="annot"><span class="annottext">(CmmAGraph -&gt; FCode ()) -&gt; FCode CmmAGraph -&gt; FCode ()
forall (m :: * -&gt; *) a b. Monad m =&gt; (a -&gt; m b) -&gt; m a -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3D%3C%3C"><span class="hs-operator hs-var">=&lt;&lt;</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr -&gt; [LocalReg] -&gt; [CmmExpr] -&gt; Key -&gt; FCode CmmAGraph
</span><a href="GHC.StgToCmm.Monad.html#mkCmmCall"><span class="hs-identifier hs-var">mkCmmCall</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681051034"><span class="hs-identifier hs-var">fun_expr</span></a></span><span> </span><span class="annot"><span class="annottext">[LocalReg]
</span><a href="#local-6989586621681051033"><span class="hs-identifier hs-var">res'</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmExpr]
</span><a href="#local-6989586621681051032"><span class="hs-identifier hs-var">args'</span></a></span><span> </span><span class="annot"><span class="annottext">Key
</span><a href="#local-6989586621681051037"><span class="hs-identifier hs-var">updfr_off</span></a></span><span>
</span><span id="line-210"></span><span>      </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-211"></span><span>        </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681051031"><span class="annot"><span class="annottext">conv :: ForeignConvention
</span><a href="#local-6989586621681051031"><span class="hs-identifier hs-var hs-var">conv</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CCallConv
-&gt; [ForeignHint]
-&gt; [ForeignHint]
-&gt; CmmReturnInfo
-&gt; ForeignConvention
</span><a href="GHC.Cmm.Node.html#ForeignConvention"><span class="hs-identifier hs-var">ForeignConvention</span></a></span><span> </span><span class="annot"><span class="annottext">CCallConv
</span><a href="GHC.Types.ForeignCall.html#CCallConv"><span class="hs-identifier hs-var">CCallConv</span></a></span><span> </span><span class="annot"><span class="annottext">[ForeignHint]
</span><a href="#local-6989586621681051028"><span class="hs-identifier hs-var">arg_hints</span></a></span><span> </span><span class="annot"><span class="annottext">[ForeignHint]
</span><a href="#local-6989586621681051027"><span class="hs-identifier hs-var">res_hints</span></a></span><span> </span><span class="annot"><span class="annottext">CmmReturnInfo
</span><a href="GHC.Cmm.Node.html#CmmMayReturn"><span class="hs-identifier hs-var">CmmMayReturn</span></a></span><span>
</span><span id="line-212"></span><span>        </span><span class="annot"><span class="annottext">CmmAGraph -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#emit"><span class="hs-identifier hs-var">emit</span></a></span><span> </span><span class="annot"><span class="annottext">(CmmAGraph -&gt; FCode ()) -&gt; CmmAGraph -&gt; FCode ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignTarget -&gt; [LocalReg] -&gt; [CmmExpr] -&gt; CmmAGraph
</span><a href="GHC.Cmm.Graph.html#mkUnsafeCall"><span class="hs-identifier hs-var">mkUnsafeCall</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmExpr -&gt; ForeignConvention -&gt; ForeignTarget
</span><a href="GHC.Cmm.Node.html#ForeignTarget"><span class="hs-identifier hs-var">ForeignTarget</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681051034"><span class="hs-identifier hs-var">fun_expr</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignConvention
</span><a href="#local-6989586621681051031"><span class="hs-identifier hs-var">conv</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[LocalReg]
</span><a href="#local-6989586621681051033"><span class="hs-identifier hs-var">res'</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmExpr]
</span><a href="#local-6989586621681051032"><span class="hs-identifier hs-var">args'</span></a></span><span>
</span><span id="line-213"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681051032"><span class="annot"><span class="annottext">[CmmExpr]
</span><a href="#local-6989586621681051032"><span class="hs-identifier hs-var">args'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681051028"><span class="annot"><span class="annottext">[ForeignHint]
</span><a href="#local-6989586621681051028"><span class="hs-identifier hs-var">arg_hints</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(CmmExpr, ForeignHint)] -&gt; ([CmmExpr], [ForeignHint])
forall a b. [(a, b)] -&gt; ([a], [b])
</span><a href="../../base/src/GHC.List.html#unzip"><span class="hs-identifier hs-var">unzip</span></a></span><span> </span><span class="annot"><span class="annottext">[(CmmExpr, ForeignHint)]
</span><a href="#local-6989586621681051048"><span class="hs-identifier hs-var">args</span></a></span><span>
</span><span id="line-214"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681051033"><span class="annot"><span class="annottext">[LocalReg]
</span><a href="#local-6989586621681051033"><span class="hs-identifier hs-var">res'</span></a></span></span><span class="hs-special">,</span><span>  </span><span id="local-6989586621681051027"><span class="annot"><span class="annottext">[ForeignHint]
</span><a href="#local-6989586621681051027"><span class="hs-identifier hs-var">res_hints</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(LocalReg, ForeignHint)] -&gt; ([LocalReg], [ForeignHint])
forall a b. [(a, b)] -&gt; ([a], [b])
</span><a href="../../base/src/GHC.List.html#unzip"><span class="hs-identifier hs-var">unzip</span></a></span><span> </span><span class="annot"><span class="annottext">[(LocalReg, ForeignHint)]
</span><a href="#local-6989586621681051050"><span class="hs-identifier hs-var">res</span></a></span><span>
</span><span id="line-215"></span><span>    </span><span id="local-6989586621681051034"><span class="annot"><span class="annottext">fun_expr :: CmmExpr
</span><a href="#local-6989586621681051034"><span class="hs-identifier hs-var hs-var">fun_expr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CLabel -&gt; CmmExpr
</span><a href="GHC.Cmm.Utils.html#mkLblExpr"><span class="hs-identifier hs-var">mkLblExpr</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681051049"><span class="hs-identifier hs-var">lbl</span></a></span><span>
</span><span id="line-216"></span><span>
</span><span id="line-217"></span><span>
</span><span id="line-218"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-219"></span><span class="hs-comment">--</span><span>
</span><span id="line-220"></span><span class="hs-comment">--      Caller-Save Registers</span><span>
</span><span id="line-221"></span><span class="hs-comment">--</span><span>
</span><span id="line-222"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-223"></span><span>
</span><span id="line-224"></span><span class="hs-comment">-- Here we generate the sequence of saves/restores required around a</span><span>
</span><span id="line-225"></span><span class="hs-comment">-- foreign call instruction.</span><span>
</span><span id="line-226"></span><span>
</span><span id="line-227"></span><span class="hs-comment">-- TODO: reconcile with includes/Regs.h</span><span>
</span><span id="line-228"></span><span class="hs-comment">--  * Regs.h claims that BaseReg should be saved last and loaded first</span><span>
</span><span id="line-229"></span><span class="hs-comment">--    * This might not have been tickled before since BaseReg is callee save</span><span>
</span><span id="line-230"></span><span class="hs-comment">--  * Regs.h saves SparkHd, ParkT1, SparkBase and SparkLim</span><span>
</span><span id="line-231"></span><span class="hs-comment">--</span><span>
</span><span id="line-232"></span><span class="hs-comment">-- This code isn't actually used right now, because callerSaves</span><span>
</span><span id="line-233"></span><span class="hs-comment">-- only ever returns true in the current universe for registers NOT in</span><span>
</span><span id="line-234"></span><span class="hs-comment">-- system_regs (just do a grep for CALLER_SAVES in</span><span>
</span><span id="line-235"></span><span class="hs-comment">-- includes/stg/MachRegs.h).  It's all one giant no-op, and for</span><span>
</span><span id="line-236"></span><span class="hs-comment">-- good reason: having to save system registers on every foreign call</span><span>
</span><span id="line-237"></span><span class="hs-comment">-- would be very expensive, so we avoid assigning them to those</span><span>
</span><span id="line-238"></span><span class="hs-comment">-- registers when we add support for an architecture.</span><span>
</span><span id="line-239"></span><span class="hs-comment">--</span><span>
</span><span id="line-240"></span><span class="hs-comment">-- Note that the old code generator actually does more work here: it</span><span>
</span><span id="line-241"></span><span class="hs-comment">-- also saves other global registers.  We can't (nor want) to do that</span><span>
</span><span id="line-242"></span><span class="hs-comment">-- here, as we don't have liveness information.  And really, we</span><span>
</span><span id="line-243"></span><span class="hs-comment">-- shouldn't be doing the workaround at this point in the pipeline, see</span><span>
</span><span id="line-244"></span><span class="hs-comment">-- Note [Register parameter passing] and the ToDo on CmmCall in</span><span>
</span><span id="line-245"></span><span class="hs-comment">-- &quot;GHC.Cmm.Node&quot;.  Right now the workaround is to avoid inlining across</span><span>
</span><span id="line-246"></span><span class="hs-comment">-- unsafe foreign calls in GHC.Cmm.Sink, but this is strictly</span><span>
</span><span id="line-247"></span><span class="hs-comment">-- temporary.</span><span>
</span><span id="line-248"></span><span class="annot"><a href="GHC.StgToCmm.Utils.html#callerSaveVolatileRegs"><span class="hs-identifier hs-type">callerSaveVolatileRegs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Graph.html#CmmAGraph"><span class="hs-identifier hs-type">CmmAGraph</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Graph.html#CmmAGraph"><span class="hs-identifier hs-type">CmmAGraph</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-249"></span><span id="callerSaveVolatileRegs"><span class="annot"><span class="annottext">callerSaveVolatileRegs :: DynFlags -&gt; (CmmAGraph, CmmAGraph)
</span><a href="GHC.StgToCmm.Utils.html#callerSaveVolatileRegs"><span class="hs-identifier hs-var hs-var">callerSaveVolatileRegs</span></a></span></span><span> </span><span id="local-6989586621681051021"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681051021"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681051020"><span class="hs-identifier hs-var">caller_save</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681051019"><span class="hs-identifier hs-var">caller_load</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-250"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-251"></span><span>    </span><span id="local-6989586621681051018"><span class="annot"><span class="annottext">platform :: Platform
</span><a href="#local-6989586621681051018"><span class="hs-identifier hs-var hs-var">platform</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Platform
</span><a href="GHC.Driver.Session.html#targetPlatform"><span class="hs-identifier hs-var hs-var">targetPlatform</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681051021"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-252"></span><span>
</span><span id="line-253"></span><span>    </span><span id="local-6989586621681051020"><span class="annot"><span class="annottext">caller_save :: CmmAGraph
</span><a href="#local-6989586621681051020"><span class="hs-identifier hs-var hs-var">caller_save</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[CmmAGraph] -&gt; CmmAGraph
</span><a href="GHC.Cmm.Graph.html#catAGraphs"><span class="hs-identifier hs-var">catAGraphs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(GlobalReg -&gt; CmmAGraph) -&gt; [GlobalReg] -&gt; [CmmAGraph]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; GlobalReg -&gt; CmmAGraph
</span><a href="GHC.StgToCmm.Utils.html#callerSaveGlobalReg"><span class="hs-identifier hs-var">callerSaveGlobalReg</span></a></span><span>    </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681051021"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[GlobalReg]
</span><a href="#local-6989586621681051015"><span class="hs-identifier hs-var">regs_to_save</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-254"></span><span>    </span><span id="local-6989586621681051019"><span class="annot"><span class="annottext">caller_load :: CmmAGraph
</span><a href="#local-6989586621681051019"><span class="hs-identifier hs-var hs-var">caller_load</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[CmmAGraph] -&gt; CmmAGraph
</span><a href="GHC.Cmm.Graph.html#catAGraphs"><span class="hs-identifier hs-var">catAGraphs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(GlobalReg -&gt; CmmAGraph) -&gt; [GlobalReg] -&gt; [CmmAGraph]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; GlobalReg -&gt; CmmAGraph
</span><a href="GHC.StgToCmm.Utils.html#callerRestoreGlobalReg"><span class="hs-identifier hs-var">callerRestoreGlobalReg</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681051021"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[GlobalReg]
</span><a href="#local-6989586621681051015"><span class="hs-identifier hs-var">regs_to_save</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-255"></span><span>
</span><span id="line-256"></span><span>    </span><span id="local-6989586621681051014"><span class="annot"><span class="annottext">system_regs :: [GlobalReg]
</span><a href="#local-6989586621681051014"><span class="hs-identifier hs-var hs-var">system_regs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">GlobalReg
</span><a href="GHC.Cmm.Expr.html#Sp"><span class="hs-identifier hs-var">Sp</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">GlobalReg
</span><a href="GHC.Cmm.Expr.html#SpLim"><span class="hs-identifier hs-var">SpLim</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">GlobalReg
</span><a href="GHC.Cmm.Expr.html#Hp"><span class="hs-identifier hs-var">Hp</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">GlobalReg
</span><a href="GHC.Cmm.Expr.html#HpLim"><span class="hs-identifier hs-var">HpLim</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">GlobalReg
</span><a href="GHC.Cmm.Expr.html#CCCS"><span class="hs-identifier hs-var">CCCS</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">GlobalReg
</span><a href="GHC.Cmm.Expr.html#CurrentTSO"><span class="hs-identifier hs-var">CurrentTSO</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">GlobalReg
</span><a href="GHC.Cmm.Expr.html#CurrentNursery"><span class="hs-identifier hs-var">CurrentNursery</span></a></span><span>
</span><span id="line-257"></span><span>                    </span><span class="hs-comment">{- ,SparkHd,SparkTl,SparkBase,SparkLim -}</span><span>
</span><span id="line-258"></span><span>                  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">GlobalReg
</span><a href="GHC.Cmm.Expr.html#BaseReg"><span class="hs-identifier hs-var">BaseReg</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-259"></span><span>
</span><span id="line-260"></span><span>    </span><span id="local-6989586621681051015"><span class="annot"><span class="annottext">regs_to_save :: [GlobalReg]
</span><a href="#local-6989586621681051015"><span class="hs-identifier hs-var hs-var">regs_to_save</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(GlobalReg -&gt; Bool) -&gt; [GlobalReg] -&gt; [GlobalReg]
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#filter"><span class="hs-identifier hs-var">filter</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; GlobalReg -&gt; Bool
</span><a href="GHC.Platform.Regs.html#callerSaves"><span class="hs-identifier hs-var">callerSaves</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681051018"><span class="hs-identifier hs-var">platform</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[GlobalReg]
</span><a href="#local-6989586621681051014"><span class="hs-identifier hs-var">system_regs</span></a></span><span>
</span><span id="line-261"></span><span>
</span><span id="line-262"></span><span class="annot"><a href="GHC.StgToCmm.Utils.html#callerSaveGlobalReg"><span class="hs-identifier hs-type">callerSaveGlobalReg</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#GlobalReg"><span class="hs-identifier hs-type">GlobalReg</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Graph.html#CmmAGraph"><span class="hs-identifier hs-type">CmmAGraph</span></a></span><span>
</span><span id="line-263"></span><span id="callerSaveGlobalReg"><span class="annot"><span class="annottext">callerSaveGlobalReg :: DynFlags -&gt; GlobalReg -&gt; CmmAGraph
</span><a href="GHC.StgToCmm.Utils.html#callerSaveGlobalReg"><span class="hs-identifier hs-var hs-var">callerSaveGlobalReg</span></a></span></span><span> </span><span id="local-6989586621681051005"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681051005"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621681051004"><span class="annot"><span class="annottext">GlobalReg
</span><a href="#local-6989586621681051004"><span class="hs-identifier hs-var">reg</span></a></span></span><span>
</span><span id="line-264"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmExpr -&gt; CmmExpr -&gt; CmmAGraph
</span><a href="GHC.Cmm.Graph.html#mkStore"><span class="hs-identifier hs-var">mkStore</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; GlobalReg -&gt; CmmExpr
</span><a href="GHC.StgToCmm.CgUtils.html#get_GlobalReg_addr"><span class="hs-identifier hs-var">get_GlobalReg_addr</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681051005"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalReg
</span><a href="#local-6989586621681051004"><span class="hs-identifier hs-var">reg</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmReg -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmReg"><span class="hs-identifier hs-var">CmmReg</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GlobalReg -&gt; CmmReg
</span><a href="GHC.Cmm.Expr.html#CmmGlobal"><span class="hs-identifier hs-var">CmmGlobal</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalReg
</span><a href="#local-6989586621681051004"><span class="hs-identifier hs-var">reg</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-265"></span><span>
</span><span id="line-266"></span><span class="annot"><a href="GHC.StgToCmm.Utils.html#callerRestoreGlobalReg"><span class="hs-identifier hs-type">callerRestoreGlobalReg</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#GlobalReg"><span class="hs-identifier hs-type">GlobalReg</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Graph.html#CmmAGraph"><span class="hs-identifier hs-type">CmmAGraph</span></a></span><span>
</span><span id="line-267"></span><span id="callerRestoreGlobalReg"><span class="annot"><span class="annottext">callerRestoreGlobalReg :: DynFlags -&gt; GlobalReg -&gt; CmmAGraph
</span><a href="GHC.StgToCmm.Utils.html#callerRestoreGlobalReg"><span class="hs-identifier hs-var hs-var">callerRestoreGlobalReg</span></a></span></span><span> </span><span id="local-6989586621681051002"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681051002"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621681051001"><span class="annot"><span class="annottext">GlobalReg
</span><a href="#local-6989586621681051001"><span class="hs-identifier hs-var">reg</span></a></span></span><span>
</span><span id="line-268"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmReg -&gt; CmmExpr -&gt; CmmAGraph
</span><a href="GHC.Cmm.Graph.html#mkAssign"><span class="hs-identifier hs-var">mkAssign</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GlobalReg -&gt; CmmReg
</span><a href="GHC.Cmm.Expr.html#CmmGlobal"><span class="hs-identifier hs-var">CmmGlobal</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalReg
</span><a href="#local-6989586621681051001"><span class="hs-identifier hs-var">reg</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-269"></span><span>               </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmExpr -&gt; CmmType -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmLoad"><span class="hs-identifier hs-var">CmmLoad</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; GlobalReg -&gt; CmmExpr
</span><a href="GHC.StgToCmm.CgUtils.html#get_GlobalReg_addr"><span class="hs-identifier hs-var">get_GlobalReg_addr</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681051002"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalReg
</span><a href="#local-6989586621681051001"><span class="hs-identifier hs-var">reg</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; GlobalReg -&gt; CmmType
</span><a href="GHC.Cmm.Expr.html#globalRegType"><span class="hs-identifier hs-var">globalRegType</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; Platform
</span><a href="GHC.Driver.Session.html#targetPlatform"><span class="hs-identifier hs-var hs-var">targetPlatform</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681051002"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">GlobalReg
</span><a href="#local-6989586621681051001"><span class="hs-identifier hs-var">reg</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-270"></span><span>
</span><span id="line-271"></span><span>
</span><span id="line-272"></span><span class="hs-comment">-------------------------------------------------------------------------</span><span>
</span><span id="line-273"></span><span class="hs-comment">--</span><span>
</span><span id="line-274"></span><span class="hs-comment">--      Strings generate a top-level data block</span><span>
</span><span id="line-275"></span><span class="hs-comment">--</span><span>
</span><span id="line-276"></span><span class="hs-comment">-------------------------------------------------------------------------</span><span>
</span><span id="line-277"></span><span>
</span><span id="line-278"></span><span class="hs-comment">-- | Emit a data-segment data block</span><span>
</span><span id="line-279"></span><span class="annot"><a href="GHC.StgToCmm.Utils.html#emitDataLits"><span class="hs-identifier hs-type">emitDataLits</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.CLabel.html#CLabel"><span class="hs-identifier hs-type">CLabel</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmLit"><span class="hs-identifier hs-type">CmmLit</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-280"></span><span id="emitDataLits"><span class="annot"><span class="annottext">emitDataLits :: CLabel -&gt; [CmmLit] -&gt; FCode ()
</span><a href="GHC.StgToCmm.Utils.html#emitDataLits"><span class="hs-identifier hs-var hs-var">emitDataLits</span></a></span></span><span> </span><span id="local-6989586621681050999"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681050999"><span class="hs-identifier hs-var">lbl</span></a></span></span><span> </span><span id="local-6989586621681050998"><span class="annot"><span class="annottext">[CmmLit]
</span><a href="#local-6989586621681050998"><span class="hs-identifier hs-var">lits</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmDecl -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#emitDecl"><span class="hs-identifier hs-var">emitDecl</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Section -&gt; CLabel -&gt; [CmmLit] -&gt; CmmDecl
forall (raw :: Bool) info stmt.
Section
-&gt; CLabel -&gt; [CmmLit] -&gt; GenCmmDecl (GenCmmStatics raw) info stmt
</span><a href="GHC.Cmm.Utils.html#mkDataLits"><span class="hs-identifier hs-var">mkDataLits</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SectionType -&gt; CLabel -&gt; Section
</span><a href="GHC.Cmm.html#Section"><span class="hs-identifier hs-var">Section</span></a></span><span> </span><span class="annot"><span class="annottext">SectionType
</span><a href="GHC.Cmm.html#Data"><span class="hs-identifier hs-var">Data</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681050999"><span class="hs-identifier hs-var">lbl</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681050999"><span class="hs-identifier hs-var">lbl</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmLit]
</span><a href="#local-6989586621681050998"><span class="hs-identifier hs-var">lits</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-281"></span><span>
</span><span id="line-282"></span><span class="hs-comment">-- | Emit a read-only data block</span><span>
</span><span id="line-283"></span><span class="annot"><a href="GHC.StgToCmm.Utils.html#emitRODataLits"><span class="hs-identifier hs-type">emitRODataLits</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.CLabel.html#CLabel"><span class="hs-identifier hs-type">CLabel</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmLit"><span class="hs-identifier hs-type">CmmLit</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-284"></span><span id="emitRODataLits"><span class="annot"><span class="annottext">emitRODataLits :: CLabel -&gt; [CmmLit] -&gt; FCode ()
</span><a href="GHC.StgToCmm.Utils.html#emitRODataLits"><span class="hs-identifier hs-var hs-var">emitRODataLits</span></a></span></span><span> </span><span id="local-6989586621681050993"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681050993"><span class="hs-identifier hs-var">lbl</span></a></span></span><span> </span><span id="local-6989586621681050992"><span class="annot"><span class="annottext">[CmmLit]
</span><a href="#local-6989586621681050992"><span class="hs-identifier hs-var">lits</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmDecl -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#emitDecl"><span class="hs-identifier hs-var">emitDecl</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CLabel -&gt; [CmmLit] -&gt; CmmDecl
forall (raw :: Bool) info stmt.
CLabel -&gt; [CmmLit] -&gt; GenCmmDecl (GenCmmStatics raw) info stmt
</span><a href="GHC.Cmm.Utils.html#mkRODataLits"><span class="hs-identifier hs-var">mkRODataLits</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681050993"><span class="hs-identifier hs-var">lbl</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmLit]
</span><a href="#local-6989586621681050992"><span class="hs-identifier hs-var">lits</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-285"></span><span>
</span><span id="line-286"></span><span class="annot"><a href="GHC.StgToCmm.Utils.html#emitDataCon"><span class="hs-identifier hs-type">emitDataCon</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.CLabel.html#CLabel"><span class="hs-identifier hs-type">CLabel</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmInfoTable"><span class="hs-identifier hs-type">CmmInfoTable</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.CostCentre.html#CostCentreStack"><span class="hs-identifier hs-type">CostCentreStack</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmLit"><span class="hs-identifier hs-type">CmmLit</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-287"></span><span id="emitDataCon"><span class="annot"><span class="annottext">emitDataCon :: CLabel -&gt; CmmInfoTable -&gt; CostCentreStack -&gt; [CmmLit] -&gt; FCode ()
</span><a href="GHC.StgToCmm.Utils.html#emitDataCon"><span class="hs-identifier hs-var hs-var">emitDataCon</span></a></span></span><span> </span><span id="local-6989586621681050990"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681050990"><span class="hs-identifier hs-var">lbl</span></a></span></span><span> </span><span id="local-6989586621681050989"><span class="annot"><span class="annottext">CmmInfoTable
</span><a href="#local-6989586621681050989"><span class="hs-identifier hs-var">itbl</span></a></span></span><span> </span><span id="local-6989586621681050988"><span class="annot"><span class="annottext">CostCentreStack
</span><a href="#local-6989586621681050988"><span class="hs-identifier hs-var">ccs</span></a></span></span><span> </span><span id="local-6989586621681050987"><span class="annot"><span class="annottext">[CmmLit]
</span><a href="#local-6989586621681050987"><span class="hs-identifier hs-var">payload</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmDecl -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#emitDecl"><span class="hs-identifier hs-var">emitDecl</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Section -&gt; GenCmmStatics 'False -&gt; CmmDecl
forall d h g. Section -&gt; d -&gt; GenCmmDecl d h g
</span><a href="GHC.Cmm.html#CmmData"><span class="hs-identifier hs-var">CmmData</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SectionType -&gt; CLabel -&gt; Section
</span><a href="GHC.Cmm.html#Section"><span class="hs-identifier hs-var">Section</span></a></span><span> </span><span class="annot"><span class="annottext">SectionType
</span><a href="GHC.Cmm.html#Data"><span class="hs-identifier hs-var">Data</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681050990"><span class="hs-identifier hs-var">lbl</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CLabel
-&gt; CmmInfoTable
-&gt; CostCentreStack
-&gt; [CmmLit]
-&gt; GenCmmStatics 'False
</span><a href="GHC.Cmm.html#CmmStatics"><span class="hs-identifier hs-var">CmmStatics</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681050990"><span class="hs-identifier hs-var">lbl</span></a></span><span> </span><span class="annot"><span class="annottext">CmmInfoTable
</span><a href="#local-6989586621681050989"><span class="hs-identifier hs-var">itbl</span></a></span><span> </span><span class="annot"><span class="annottext">CostCentreStack
</span><a href="#local-6989586621681050988"><span class="hs-identifier hs-var">ccs</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmLit]
</span><a href="#local-6989586621681050987"><span class="hs-identifier hs-var">payload</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-288"></span><span>
</span><span id="line-289"></span><span class="annot"><a href="GHC.StgToCmm.Utils.html#newStringCLit"><span class="hs-identifier hs-type">newStringCLit</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmLit"><span class="hs-identifier hs-type">CmmLit</span></a></span><span>
</span><span id="line-290"></span><span class="hs-comment">-- Make a global definition for the string,</span><span>
</span><span id="line-291"></span><span class="hs-comment">-- and return its label</span><span>
</span><span id="line-292"></span><span id="newStringCLit"><span class="annot"><span class="annottext">newStringCLit :: String -&gt; FCode CmmLit
</span><a href="GHC.StgToCmm.Utils.html#newStringCLit"><span class="hs-identifier hs-var hs-var">newStringCLit</span></a></span></span><span> </span><span id="local-6989586621681050984"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681050984"><span class="hs-identifier hs-var">str</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; FCode CmmLit
</span><a href="GHC.StgToCmm.Utils.html#newByteStringCLit"><span class="hs-identifier hs-var">newByteStringCLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; ByteString
</span><a href="../../bytestring/src/Data.ByteString.Char8.html#pack"><span class="hs-identifier hs-var">BS8.pack</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681050984"><span class="hs-identifier hs-var">str</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-293"></span><span>
</span><span id="line-294"></span><span class="annot"><a href="GHC.StgToCmm.Utils.html#newByteStringCLit"><span class="hs-identifier hs-type">newByteStringCLit</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmLit"><span class="hs-identifier hs-type">CmmLit</span></a></span><span>
</span><span id="line-295"></span><span id="newByteStringCLit"><span class="annot"><span class="annottext">newByteStringCLit :: ByteString -&gt; FCode CmmLit
</span><a href="GHC.StgToCmm.Utils.html#newByteStringCLit"><span class="hs-identifier hs-var hs-var">newByteStringCLit</span></a></span></span><span> </span><span id="local-6989586621681050982"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621681050982"><span class="hs-identifier hs-var">bytes</span></a></span></span><span>
</span><span id="line-296"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681050981"><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621681050981"><span class="hs-identifier hs-var">uniq</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode Unique
</span><a href="GHC.StgToCmm.Monad.html#newUnique"><span class="hs-identifier hs-var">newUnique</span></a></span><span>
</span><span id="line-297"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681050979"><span class="annot"><span class="annottext">CmmLit
</span><a href="#local-6989586621681050979"><span class="hs-identifier hs-var">lit</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681050978"><span class="annot"><span class="annottext">GenCmmDecl (GenCmmStatics raw) info stmt
</span><a href="#local-6989586621681050978"><span class="hs-identifier hs-var">decl</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CLabel
-&gt; ByteString -&gt; (CmmLit, GenCmmDecl (GenCmmStatics raw) info stmt)
forall (raw :: Bool) info stmt.
CLabel
-&gt; ByteString -&gt; (CmmLit, GenCmmDecl (GenCmmStatics raw) info stmt)
</span><a href="GHC.Cmm.Utils.html#mkByteStringCLit"><span class="hs-identifier hs-var">mkByteStringCLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Unique -&gt; CLabel
</span><a href="GHC.Cmm.CLabel.html#mkStringLitLabel"><span class="hs-identifier hs-var">mkStringLitLabel</span></a></span><span> </span><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621681050981"><span class="hs-identifier hs-var">uniq</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621681050982"><span class="hs-identifier hs-var">bytes</span></a></span><span>
</span><span id="line-298"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">CmmDecl -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#emitDecl"><span class="hs-identifier hs-var">emitDecl</span></a></span><span> </span><span class="annot"><span class="annottext">CmmDecl
forall {raw :: Bool} {info} {stmt}.
GenCmmDecl (GenCmmStatics raw) info stmt
</span><a href="#local-6989586621681050978"><span class="hs-identifier hs-var">decl</span></a></span><span>
</span><span id="line-299"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">CmmLit -&gt; FCode CmmLit
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">CmmLit
</span><a href="#local-6989586621681050979"><span class="hs-identifier hs-var">lit</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-300"></span><span>
</span><span id="line-301"></span><span class="hs-comment">-------------------------------------------------------------------------</span><span>
</span><span id="line-302"></span><span class="hs-comment">--</span><span>
</span><span id="line-303"></span><span class="hs-comment">--      Assigning expressions to temporaries</span><span>
</span><span id="line-304"></span><span class="hs-comment">--</span><span>
</span><span id="line-305"></span><span class="hs-comment">-------------------------------------------------------------------------</span><span>
</span><span id="line-306"></span><span>
</span><span id="line-307"></span><span class="annot"><a href="GHC.StgToCmm.Utils.html#assignTemp"><span class="hs-identifier hs-type">assignTemp</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#LocalReg"><span class="hs-identifier hs-type">LocalReg</span></a></span><span>
</span><span id="line-308"></span><span class="hs-comment">-- Make sure the argument is in a local register.</span><span>
</span><span id="line-309"></span><span class="hs-comment">-- We don't bother being particularly aggressive with avoiding</span><span>
</span><span id="line-310"></span><span class="hs-comment">-- unnecessary local registers, since we can rely on a later</span><span>
</span><span id="line-311"></span><span class="hs-comment">-- optimization pass to inline as necessary (and skipping out</span><span>
</span><span id="line-312"></span><span class="hs-comment">-- on things like global registers can be a little dangerous</span><span>
</span><span id="line-313"></span><span class="hs-comment">-- due to them being trashed on foreign calls--though it means</span><span>
</span><span id="line-314"></span><span class="hs-comment">-- the optimization pass doesn't have to do as much work)</span><span>
</span><span id="line-315"></span><span id="assignTemp"><span class="annot"><span class="annottext">assignTemp :: CmmExpr -&gt; FCode LocalReg
</span><a href="GHC.StgToCmm.Utils.html#assignTemp"><span class="hs-identifier hs-var hs-var">assignTemp</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmReg"><span class="hs-identifier hs-type">CmmReg</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmLocal"><span class="hs-identifier hs-type">CmmLocal</span></a></span><span> </span><span id="local-6989586621681050975"><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681050975"><span class="hs-identifier hs-var">reg</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LocalReg -&gt; FCode LocalReg
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681050975"><span class="hs-identifier hs-var">reg</span></a></span><span>
</span><span id="line-316"></span><span class="annot"><a href="GHC.StgToCmm.Utils.html#assignTemp"><span class="hs-identifier hs-var">assignTemp</span></a></span><span> </span><span id="local-6989586621681050974"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681050974"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681050973"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681050973"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode Platform
</span><a href="GHC.StgToCmm.Monad.html#getPlatform"><span class="hs-identifier hs-var">getPlatform</span></a></span><span>
</span><span id="line-317"></span><span>                  </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681050972"><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621681050972"><span class="hs-identifier hs-var">uniq</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode Unique
</span><a href="GHC.StgToCmm.Monad.html#newUnique"><span class="hs-identifier hs-var">newUnique</span></a></span><span>
</span><span id="line-318"></span><span>                  </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681050971"><span class="annot"><span class="annottext">reg :: LocalReg
</span><a href="#local-6989586621681050971"><span class="hs-identifier hs-var hs-var">reg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Unique -&gt; CmmType -&gt; LocalReg
</span><a href="GHC.Cmm.Expr.html#LocalReg"><span class="hs-identifier hs-var">LocalReg</span></a></span><span> </span><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621681050972"><span class="hs-identifier hs-var">uniq</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; CmmExpr -&gt; CmmType
</span><a href="GHC.Cmm.Expr.html#cmmExprType"><span class="hs-identifier hs-var">cmmExprType</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681050973"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681050974"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-319"></span><span>                  </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">CmmReg -&gt; CmmExpr -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#emitAssign"><span class="hs-identifier hs-var">emitAssign</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LocalReg -&gt; CmmReg
</span><a href="GHC.Cmm.Expr.html#CmmLocal"><span class="hs-identifier hs-var">CmmLocal</span></a></span><span> </span><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681050971"><span class="hs-identifier hs-var">reg</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681050974"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-320"></span><span>                  </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">LocalReg -&gt; FCode LocalReg
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681050971"><span class="hs-identifier hs-var">reg</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-321"></span><span>
</span><span id="line-322"></span><span id="local-6989586621681051349"><span class="annot"><a href="GHC.StgToCmm.Utils.html#newTemp"><span class="hs-identifier hs-type">newTemp</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#MonadUnique"><span class="hs-identifier hs-type">MonadUnique</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681051349"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Type.html#CmmType"><span class="hs-identifier hs-type">CmmType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681051349"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#LocalReg"><span class="hs-identifier hs-type">LocalReg</span></a></span></span><span>
</span><span id="line-323"></span><span id="newTemp"><span class="annot"><span class="annottext">newTemp :: forall (m :: * -&gt; *). MonadUnique m =&gt; CmmType -&gt; m LocalReg
</span><a href="GHC.StgToCmm.Utils.html#newTemp"><span class="hs-identifier hs-var hs-var">newTemp</span></a></span></span><span> </span><span id="local-6989586621681050961"><span class="annot"><span class="annottext">CmmType
</span><a href="#local-6989586621681050961"><span class="hs-identifier hs-var">rep</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681050960"><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621681050960"><span class="hs-identifier hs-var">uniq</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m Unique
forall (m :: * -&gt; *). MonadUnique m =&gt; m Unique
</span><a href="GHC.Types.Unique.Supply.html#getUniqueM"><span class="hs-identifier hs-var">getUniqueM</span></a></span><span>
</span><span id="line-324"></span><span>                 </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">LocalReg -&gt; m LocalReg
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Unique -&gt; CmmType -&gt; LocalReg
</span><a href="GHC.Cmm.Expr.html#LocalReg"><span class="hs-identifier hs-var">LocalReg</span></a></span><span> </span><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621681050960"><span class="hs-identifier hs-var">uniq</span></a></span><span> </span><span class="annot"><span class="annottext">CmmType
</span><a href="#local-6989586621681050961"><span class="hs-identifier hs-var">rep</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-325"></span><span>
</span><span id="line-326"></span><span class="annot"><a href="GHC.StgToCmm.Utils.html#newUnboxedTupleRegs"><span class="hs-identifier hs-type">newUnboxedTupleRegs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.Expr.html#LocalReg"><span class="hs-identifier hs-type">LocalReg</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.Type.html#ForeignHint"><span class="hs-identifier hs-type">ForeignHint</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-327"></span><span class="hs-comment">-- Choose suitable local regs to use for the components</span><span>
</span><span id="line-328"></span><span class="hs-comment">-- of an unboxed tuple that we are about to return to</span><span>
</span><span id="line-329"></span><span class="hs-comment">-- the Sequel.  If the Sequel is a join point, using the</span><span>
</span><span id="line-330"></span><span class="hs-comment">-- regs it wants will save later assignments.</span><span>
</span><span id="line-331"></span><span id="newUnboxedTupleRegs"><span class="annot"><span class="annottext">newUnboxedTupleRegs :: Type -&gt; FCode ([LocalReg], [ForeignHint])
</span><a href="GHC.StgToCmm.Utils.html#newUnboxedTupleRegs"><span class="hs-identifier hs-var hs-var">newUnboxedTupleRegs</span></a></span></span><span> </span><span id="local-6989586621681050958"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681050958"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span>
</span><span id="line-332"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">ASSERT</span><span class="hs-special">(</span><span> </span><span class="hs-identifier">isUnboxedTupleType</span><span> </span><span class="hs-identifier">res_ty</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-333"></span><span>    </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681050952"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681050952"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode Platform
</span><a href="GHC.StgToCmm.Monad.html#getPlatform"><span class="hs-identifier hs-var">getPlatform</span></a></span><span>
</span><span id="line-334"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681050951"><span class="annot"><span class="annottext">Sequel
</span><a href="#local-6989586621681050951"><span class="hs-identifier hs-var">sequel</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode Sequel
</span><a href="GHC.StgToCmm.Monad.html#getSequel"><span class="hs-identifier hs-var">getSequel</span></a></span><span>
</span><span id="line-335"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681050949"><span class="annot"><span class="annottext">[LocalReg]
</span><a href="#local-6989586621681050949"><span class="hs-identifier hs-var">regs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; Sequel -&gt; FCode [LocalReg]
forall {m :: * -&gt; *}.
MonadUnique m =&gt;
Platform -&gt; Sequel -&gt; m [LocalReg]
</span><a href="#local-6989586621681050948"><span class="hs-identifier hs-var">choose_regs</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681050952"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">Sequel
</span><a href="#local-6989586621681050951"><span class="hs-identifier hs-var">sequel</span></a></span><span>
</span><span id="line-336"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-identifier">ASSERT</span><span class="hs-special">(</span><span> </span><span class="hs-identifier">regs</span><span> </span><span class="hs-special">`</span><span class="hs-identifier">equalLength</span><span class="hs-special">`</span><span> </span><span class="hs-identifier">reps</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-337"></span><span>          </span><span class="annot"><span class="annottext">([LocalReg], [ForeignHint]) -&gt; FCode ([LocalReg], [ForeignHint])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[LocalReg]
</span><a href="#local-6989586621681050949"><span class="hs-identifier hs-var">regs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">(PrimRep -&gt; ForeignHint) -&gt; [PrimRep] -&gt; [ForeignHint]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">PrimRep -&gt; ForeignHint
</span><a href="GHC.Cmm.Utils.html#primRepForeignHint"><span class="hs-identifier hs-var">primRepForeignHint</span></a></span><span> </span><span class="annot"><span class="annottext">[PrimRep]
</span><a href="#local-6989586621681050946"><span class="hs-identifier hs-var">reps</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-338"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-339"></span><span>    </span><span id="local-6989586621681050946"><span class="annot"><span class="annottext">reps :: [PrimRep]
</span><a href="#local-6989586621681050946"><span class="hs-identifier hs-var hs-var">reps</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Type -&gt; [PrimRep]
Type -&gt; [PrimRep]
</span><a href="GHC.Types.RepType.html#typePrimRep"><span class="hs-identifier hs-var">typePrimRep</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681050958"><span class="hs-identifier hs-var">res_ty</span></a></span><span>
</span><span id="line-340"></span><span>    </span><span id="local-6989586621681050948"><span class="annot"><span class="annottext">choose_regs :: Platform -&gt; Sequel -&gt; m [LocalReg]
</span><a href="#local-6989586621681050948"><span class="hs-identifier hs-var hs-var">choose_regs</span></a></span></span><span> </span><span class="annot"><span class="annottext">Platform
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.StgToCmm.Monad.html#AssignTo"><span class="hs-identifier hs-type">AssignTo</span></a></span><span> </span><span id="local-6989586621681050933"><span class="annot"><span class="annottext">[LocalReg]
</span><a href="#local-6989586621681050933"><span class="hs-identifier hs-var">regs</span></a></span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[LocalReg] -&gt; m [LocalReg]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">[LocalReg]
</span><a href="#local-6989586621681050933"><span class="hs-identifier hs-var">regs</span></a></span><span>
</span><span id="line-341"></span><span>    </span><span class="annot"><a href="#local-6989586621681050948"><span class="hs-identifier hs-var">choose_regs</span></a></span><span> </span><span id="local-6989586621681050932"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681050932"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span class="annot"><span class="annottext">Sequel
</span><span class="hs-identifier">_</span></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(PrimRep -&gt; m LocalReg) -&gt; [PrimRep] -&gt; m [LocalReg]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmType -&gt; m LocalReg
forall (m :: * -&gt; *). MonadUnique m =&gt; CmmType -&gt; m LocalReg
</span><a href="GHC.StgToCmm.Utils.html#newTemp"><span class="hs-identifier hs-var">newTemp</span></a></span><span> </span><span class="annot"><span class="annottext">(CmmType -&gt; m LocalReg)
-&gt; (PrimRep -&gt; CmmType) -&gt; PrimRep -&gt; m LocalReg
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Platform -&gt; PrimRep -&gt; CmmType
</span><a href="GHC.Cmm.Utils.html#primRepCmmType"><span class="hs-identifier hs-var">primRepCmmType</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681050932"><span class="hs-identifier hs-var">platform</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[PrimRep]
</span><a href="#local-6989586621681050946"><span class="hs-identifier hs-var">reps</span></a></span><span>
</span><span id="line-342"></span><span>
</span><span id="line-343"></span><span>
</span><span id="line-344"></span><span>
</span><span id="line-345"></span><span class="hs-comment">-------------------------------------------------------------------------</span><span>
</span><span id="line-346"></span><span class="hs-comment">--      emitMultiAssign</span><span>
</span><span id="line-347"></span><span class="hs-comment">-------------------------------------------------------------------------</span><span>
</span><span id="line-348"></span><span>
</span><span id="line-349"></span><span class="annot"><a href="GHC.StgToCmm.Utils.html#emitMultiAssign"><span class="hs-identifier hs-type">emitMultiAssign</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.Expr.html#LocalReg"><span class="hs-identifier hs-type">LocalReg</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-350"></span><span class="hs-comment">-- Emit code to perform the assignments in the</span><span>
</span><span id="line-351"></span><span class="hs-comment">-- input simultaneously, using temporary variables when necessary.</span><span>
</span><span id="line-352"></span><span>
</span><span id="line-353"></span><span class="hs-keyword">type</span><span> </span><span id="Key"><span class="annot"><a href="GHC.StgToCmm.Utils.html#Key"><span class="hs-identifier hs-var">Key</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-354"></span><span class="hs-keyword">type</span><span> </span><span id="Vrtx"><span class="annot"><a href="GHC.StgToCmm.Utils.html#Vrtx"><span class="hs-identifier hs-var">Vrtx</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.StgToCmm.Utils.html#Key"><span class="hs-identifier hs-type">Key</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Utils.html#Stmt"><span class="hs-identifier hs-type">Stmt</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- Give each vertex a unique number,</span><span>
</span><span id="line-355"></span><span>                        </span><span class="hs-comment">-- for fast comparison</span><span>
</span><span id="line-356"></span><span class="hs-keyword">type</span><span> </span><span id="Stmt"><span class="annot"><a href="GHC.StgToCmm.Utils.html#Stmt"><span class="hs-identifier hs-var">Stmt</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#LocalReg"><span class="hs-identifier hs-type">LocalReg</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- r := e</span><span>
</span><span id="line-357"></span><span>
</span><span id="line-358"></span><span class="hs-comment">-- We use the strongly-connected component algorithm, in which</span><span>
</span><span id="line-359"></span><span class="hs-comment">--      * the vertices are the statements</span><span>
</span><span id="line-360"></span><span class="hs-comment">--      * an edge goes from s1 to s2 iff</span><span>
</span><span id="line-361"></span><span class="hs-comment">--              s1 assigns to something s2 uses</span><span>
</span><span id="line-362"></span><span class="hs-comment">--        that is, if s1 should *follow* s2 in the final order</span><span>
</span><span id="line-363"></span><span>
</span><span id="line-364"></span><span id="emitMultiAssign"><span class="annot"><span class="annottext">emitMultiAssign :: [LocalReg] -&gt; [CmmExpr] -&gt; FCode ()
</span><a href="GHC.StgToCmm.Utils.html#emitMultiAssign"><span class="hs-identifier hs-var hs-var">emitMultiAssign</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>    </span><span class="hs-special">[</span><span class="hs-special">]</span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; FCode ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-365"></span><span class="annot"><a href="GHC.StgToCmm.Utils.html#emitMultiAssign"><span class="hs-identifier hs-var">emitMultiAssign</span></a></span><span> </span><span class="hs-special">[</span><span id="local-6989586621681050927"><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681050927"><span class="hs-identifier hs-var">reg</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-special">[</span><span id="local-6989586621681050926"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681050926"><span class="hs-identifier hs-var">rhs</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmReg -&gt; CmmExpr -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#emitAssign"><span class="hs-identifier hs-var">emitAssign</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LocalReg -&gt; CmmReg
</span><a href="GHC.Cmm.Expr.html#CmmLocal"><span class="hs-identifier hs-var">CmmLocal</span></a></span><span> </span><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681050927"><span class="hs-identifier hs-var">reg</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681050926"><span class="hs-identifier hs-var">rhs</span></a></span><span>
</span><span id="line-366"></span><span class="annot"><a href="GHC.StgToCmm.Utils.html#emitMultiAssign"><span class="hs-identifier hs-var">emitMultiAssign</span></a></span><span> </span><span id="local-6989586621681050925"><span class="annot"><span class="annottext">[LocalReg]
</span><a href="#local-6989586621681050925"><span class="hs-identifier hs-var">regs</span></a></span></span><span> </span><span id="local-6989586621681050924"><span class="annot"><span class="annottext">[CmmExpr]
</span><a href="#local-6989586621681050924"><span class="hs-identifier hs-var">rhss</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-367"></span><span>  </span><span id="local-6989586621681050923"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681050923"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode Platform
</span><a href="GHC.StgToCmm.Monad.html#getPlatform"><span class="hs-identifier hs-var">getPlatform</span></a></span><span>
</span><span id="line-368"></span><span>  </span><span class="hs-identifier">ASSERT2</span><span class="hs-special">(</span><span> </span><span class="hs-identifier">equalLength</span><span> </span><span class="hs-identifier">regs</span><span> </span><span class="hs-identifier">rhss</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">ppr</span><span> </span><span class="hs-identifier">regs</span><span> </span><span class="hs-operator">$$</span><span> </span><span class="hs-identifier">ppr</span><span> </span><span class="hs-identifier">rhss</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-369"></span><span>    </span><span class="annot"><span class="annottext">Platform -&gt; [Vrtx] -&gt; FCode ()
</span><a href="GHC.StgToCmm.Utils.html#unscramble"><span class="hs-identifier hs-var">unscramble</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681050923"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><span class="annottext">Key
</span><span class="hs-number">1</span></span><span class="hs-glyph">..</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">[Key] -&gt; [(LocalReg, CmmExpr)] -&gt; [Vrtx]
forall a b. [a] -&gt; [b] -&gt; [(a, b)]
</span><a href="../../base/src/GHC.List.html#zip"><span class="hs-operator hs-var">`zip`</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[LocalReg]
</span><a href="#local-6989586621681050925"><span class="hs-identifier hs-var">regs</span></a></span><span> </span><span class="annot"><span class="annottext">[LocalReg] -&gt; [CmmExpr] -&gt; [(LocalReg, CmmExpr)]
forall a b. [a] -&gt; [b] -&gt; [(a, b)]
</span><a href="../../base/src/GHC.List.html#zip"><span class="hs-operator hs-var">`zip`</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmExpr]
</span><a href="#local-6989586621681050924"><span class="hs-identifier hs-var">rhss</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-370"></span><span>
</span><span id="line-371"></span><span class="annot"><a href="GHC.StgToCmm.Utils.html#unscramble"><span class="hs-identifier hs-type">unscramble</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#Platform"><span class="hs-identifier hs-type">Platform</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.StgToCmm.Utils.html#Vrtx"><span class="hs-identifier hs-type">Vrtx</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-372"></span><span id="unscramble"><span class="annot"><span class="annottext">unscramble :: Platform -&gt; [Vrtx] -&gt; FCode ()
</span><a href="GHC.StgToCmm.Utils.html#unscramble"><span class="hs-identifier hs-var hs-var">unscramble</span></a></span></span><span> </span><span id="local-6989586621681050919"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681050919"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span id="local-6989586621681050918"><span class="annot"><span class="annottext">[Vrtx]
</span><a href="#local-6989586621681050918"><span class="hs-identifier hs-var">vertices</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(SCC Vrtx -&gt; FCode ()) -&gt; [SCC Vrtx] -&gt; FCode ()
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Foldable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m ()
</span><a href="../../base/src/Data.Foldable.html#mapM_"><span class="hs-identifier hs-var">mapM_</span></a></span><span> </span><span class="annot"><span class="annottext">SCC Vrtx -&gt; FCode ()
</span><a href="#local-6989586621681050916"><span class="hs-identifier hs-var">do_component</span></a></span><span> </span><span class="annot"><span class="annottext">[SCC Vrtx]
</span><a href="#local-6989586621681050915"><span class="hs-identifier hs-var">components</span></a></span><span>
</span><span id="line-373"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-374"></span><span>        </span><span class="annot"><a href="#local-6989586621681050914"><span class="hs-identifier hs-type">edges</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><a href="GHC.Data.Graph.Directed.html#Node"><span class="hs-identifier hs-type">Node</span></a></span><span> </span><span class="annot"><a href="GHC.StgToCmm.Utils.html#Key"><span class="hs-identifier hs-type">Key</span></a></span><span> </span><span class="annot"><a href="GHC.StgToCmm.Utils.html#Vrtx"><span class="hs-identifier hs-type">Vrtx</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-375"></span><span>        </span><span id="local-6989586621681050914"><span class="annot"><span class="annottext">edges :: [Node Key Vrtx]
</span><a href="#local-6989586621681050914"><span class="hs-identifier hs-var hs-var">edges</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">Vrtx -&gt; Key -&gt; [Key] -&gt; Node Key Vrtx
forall key payload. payload -&gt; key -&gt; [key] -&gt; Node key payload
</span><a href="GHC.Data.Graph.Directed.html#DigraphNode"><span class="hs-identifier hs-var">DigraphNode</span></a></span><span> </span><span class="annot"><span class="annottext">Vrtx
</span><a href="#local-6989586621681050912"><span class="hs-identifier hs-var">vertex</span></a></span><span> </span><span class="annot"><span class="annottext">Key
</span><a href="#local-6989586621681050911"><span class="hs-identifier hs-var">key1</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(LocalReg, CmmExpr) -&gt; [Key]
</span><a href="#local-6989586621681050910"><span class="hs-identifier hs-var">edges_from</span></a></span><span> </span><span class="annot"><span class="annottext">(LocalReg, CmmExpr)
</span><a href="#local-6989586621681050909"><span class="hs-identifier hs-var">stmt1</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-376"></span><span>                </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681050912"><span class="annot"><span class="annottext">vertex :: Vrtx
</span><a href="#local-6989586621681050912"><span class="hs-identifier hs-var">vertex</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span id="local-6989586621681050911"><span class="annot"><span class="annottext">Key
</span><a href="#local-6989586621681050911"><span class="hs-identifier hs-var">key1</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681050909"><span class="annot"><span class="annottext">(LocalReg, CmmExpr)
</span><a href="#local-6989586621681050909"><span class="hs-identifier hs-var">stmt1</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Vrtx]
</span><a href="#local-6989586621681050918"><span class="hs-identifier hs-var">vertices</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-377"></span><span>
</span><span id="line-378"></span><span>        </span><span class="annot"><a href="#local-6989586621681050910"><span class="hs-identifier hs-type">edges_from</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Utils.html#Stmt"><span class="hs-identifier hs-type">Stmt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.StgToCmm.Utils.html#Key"><span class="hs-identifier hs-type">Key</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-379"></span><span>        </span><span id="local-6989586621681050910"><span class="annot"><span class="annottext">edges_from :: (LocalReg, CmmExpr) -&gt; [Key]
</span><a href="#local-6989586621681050910"><span class="hs-identifier hs-var hs-var">edges_from</span></a></span></span><span> </span><span id="local-6989586621681050908"><span class="annot"><span class="annottext">(LocalReg, CmmExpr)
</span><a href="#local-6989586621681050908"><span class="hs-identifier hs-var">stmt1</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">Key
</span><a href="#local-6989586621681050907"><span class="hs-identifier hs-var">key2</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681050907"><span class="annot"><span class="annottext">Key
</span><a href="#local-6989586621681050907"><span class="hs-identifier hs-var">key2</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681050906"><span class="annot"><span class="annottext">(LocalReg, CmmExpr)
</span><a href="#local-6989586621681050906"><span class="hs-identifier hs-var">stmt2</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Vrtx]
</span><a href="#local-6989586621681050918"><span class="hs-identifier hs-var">vertices</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-380"></span><span>                                    </span><span class="annot"><span class="annottext">(LocalReg, CmmExpr)
</span><a href="#local-6989586621681050908"><span class="hs-identifier hs-var">stmt1</span></a></span><span> </span><span class="annot"><span class="annottext">(LocalReg, CmmExpr) -&gt; (LocalReg, CmmExpr) -&gt; Bool
</span><a href="#local-6989586621681050905"><span class="hs-operator hs-var">`mustFollow`</span></a></span><span> </span><span class="annot"><span class="annottext">(LocalReg, CmmExpr)
</span><a href="#local-6989586621681050906"><span class="hs-identifier hs-var">stmt2</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-381"></span><span>
</span><span id="line-382"></span><span>        </span><span class="annot"><a href="#local-6989586621681050915"><span class="hs-identifier hs-type">components</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../containers/src/Data.Graph.html#SCC"><span class="hs-identifier hs-type">SCC</span></a></span><span> </span><span class="annot"><a href="GHC.StgToCmm.Utils.html#Vrtx"><span class="hs-identifier hs-type">Vrtx</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-383"></span><span>        </span><span id="local-6989586621681050915"><span class="annot"><span class="annottext">components :: [SCC Vrtx]
</span><a href="#local-6989586621681050915"><span class="hs-identifier hs-var hs-var">components</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Node Key Vrtx] -&gt; [SCC Vrtx]
forall key payload.
Uniquable key =&gt;
[Node key payload] -&gt; [SCC payload]
</span><a href="GHC.Data.Graph.Directed.html#stronglyConnCompFromEdgedVerticesUniq"><span class="hs-identifier hs-var">stronglyConnCompFromEdgedVerticesUniq</span></a></span><span> </span><span class="annot"><span class="annottext">[Node Key Vrtx]
</span><a href="#local-6989586621681050914"><span class="hs-identifier hs-var">edges</span></a></span><span>
</span><span id="line-384"></span><span>
</span><span id="line-385"></span><span>        </span><span class="hs-comment">-- do_components deal with one strongly-connected component</span><span>
</span><span id="line-386"></span><span>        </span><span class="hs-comment">-- Not cyclic, or singleton?  Just do it</span><span>
</span><span id="line-387"></span><span>        </span><span class="annot"><a href="#local-6989586621681050916"><span class="hs-identifier hs-type">do_component</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../containers/src/Data.Graph.html#SCC"><span class="hs-identifier hs-type">SCC</span></a></span><span> </span><span class="annot"><a href="GHC.StgToCmm.Utils.html#Vrtx"><span class="hs-identifier hs-type">Vrtx</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-388"></span><span>        </span><span id="local-6989586621681050916"><span class="annot"><span class="annottext">do_component :: SCC Vrtx -&gt; FCode ()
</span><a href="#local-6989586621681050916"><span class="hs-identifier hs-var hs-var">do_component</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../containers/src/Data.Graph.html#AcyclicSCC"><span class="hs-identifier hs-type">AcyclicSCC</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Key
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span id="local-6989586621681050902"><span class="annot"><span class="annottext">(LocalReg, CmmExpr)
</span><a href="#local-6989586621681050902"><span class="hs-identifier hs-var">stmt</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(LocalReg, CmmExpr) -&gt; FCode ()
</span><a href="#local-6989586621681050901"><span class="hs-identifier hs-var">mk_graph</span></a></span><span> </span><span class="annot"><span class="annottext">(LocalReg, CmmExpr)
</span><a href="#local-6989586621681050902"><span class="hs-identifier hs-var">stmt</span></a></span><span>
</span><span id="line-389"></span><span>        </span><span class="annot"><a href="#local-6989586621681050916"><span class="hs-identifier hs-var">do_component</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../containers/src/Data.Graph.html#CyclicSCC"><span class="hs-identifier hs-type">CyclicSCC</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; FCode ()
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;do_component&quot;</span></span><span>
</span><span id="line-390"></span><span>        </span><span class="annot"><a href="#local-6989586621681050916"><span class="hs-identifier hs-var">do_component</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../containers/src/Data.Graph.html#CyclicSCC"><span class="hs-identifier hs-type">CyclicSCC</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Key
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span id="local-6989586621681050898"><span class="annot"><span class="annottext">(LocalReg, CmmExpr)
</span><a href="#local-6989586621681050898"><span class="hs-identifier hs-var">stmt</span></a></span></span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(LocalReg, CmmExpr) -&gt; FCode ()
</span><a href="#local-6989586621681050901"><span class="hs-identifier hs-var">mk_graph</span></a></span><span> </span><span class="annot"><span class="annottext">(LocalReg, CmmExpr)
</span><a href="#local-6989586621681050898"><span class="hs-identifier hs-var">stmt</span></a></span><span>
</span><span id="line-391"></span><span>
</span><span id="line-392"></span><span>                </span><span class="hs-comment">-- Cyclic?  Then go via temporaries.  Pick one to</span><span>
</span><span id="line-393"></span><span>                </span><span class="hs-comment">-- break the loop and try again with the rest.</span><span>
</span><span id="line-394"></span><span>        </span><span class="annot"><a href="#local-6989586621681050916"><span class="hs-identifier hs-var">do_component</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../containers/src/Data.Graph.html#CyclicSCC"><span class="hs-identifier hs-type">CyclicSCC</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Key
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span id="local-6989586621681050897"><span class="annot"><span class="annottext">(LocalReg, CmmExpr)
</span><a href="#local-6989586621681050897"><span class="hs-identifier hs-var">first_stmt</span></a></span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621681050896"><span class="annot"><span class="annottext">[Vrtx]
</span><a href="#local-6989586621681050896"><span class="hs-identifier hs-var">rest</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-395"></span><span>            </span><span id="local-6989586621681050895"><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621681050895"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode Unique
</span><a href="GHC.StgToCmm.Monad.html#newUnique"><span class="hs-identifier hs-var">newUnique</span></a></span><span>
</span><span id="line-396"></span><span>            </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681050894"><span class="annot"><span class="annottext">(LocalReg, CmmExpr)
</span><a href="#local-6989586621681050894"><span class="hs-identifier hs-var">to_tmp</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681050893"><span class="annot"><span class="annottext">(LocalReg, CmmExpr)
</span><a href="#local-6989586621681050893"><span class="hs-identifier hs-var">from_tmp</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Unique
-&gt; (LocalReg, CmmExpr)
-&gt; ((LocalReg, CmmExpr), (LocalReg, CmmExpr))
</span><a href="#local-6989586621681050892"><span class="hs-identifier hs-var">split</span></a></span><span> </span><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621681050895"><span class="hs-identifier hs-var">u</span></a></span><span> </span><span class="annot"><span class="annottext">(LocalReg, CmmExpr)
</span><a href="#local-6989586621681050897"><span class="hs-identifier hs-var">first_stmt</span></a></span><span>
</span><span id="line-397"></span><span>            </span><span class="annot"><span class="annottext">(LocalReg, CmmExpr) -&gt; FCode ()
</span><a href="#local-6989586621681050901"><span class="hs-identifier hs-var">mk_graph</span></a></span><span> </span><span class="annot"><span class="annottext">(LocalReg, CmmExpr)
</span><a href="#local-6989586621681050894"><span class="hs-identifier hs-var">to_tmp</span></a></span><span>
</span><span id="line-398"></span><span>            </span><span class="annot"><span class="annottext">Platform -&gt; [Vrtx] -&gt; FCode ()
</span><a href="GHC.StgToCmm.Utils.html#unscramble"><span class="hs-identifier hs-var">unscramble</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681050919"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">[Vrtx]
</span><a href="#local-6989586621681050896"><span class="hs-identifier hs-var">rest</span></a></span><span>
</span><span id="line-399"></span><span>            </span><span class="annot"><span class="annottext">(LocalReg, CmmExpr) -&gt; FCode ()
</span><a href="#local-6989586621681050901"><span class="hs-identifier hs-var">mk_graph</span></a></span><span> </span><span class="annot"><span class="annottext">(LocalReg, CmmExpr)
</span><a href="#local-6989586621681050893"><span class="hs-identifier hs-var">from_tmp</span></a></span><span>
</span><span id="line-400"></span><span>
</span><span id="line-401"></span><span>        </span><span class="annot"><a href="#local-6989586621681050892"><span class="hs-identifier hs-type">split</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Unique.html#Unique"><span class="hs-identifier hs-type">Unique</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Utils.html#Stmt"><span class="hs-identifier hs-type">Stmt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.StgToCmm.Utils.html#Stmt"><span class="hs-identifier hs-type">Stmt</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Utils.html#Stmt"><span class="hs-identifier hs-type">Stmt</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-402"></span><span>        </span><span id="local-6989586621681050892"><span class="annot"><span class="annottext">split :: Unique
-&gt; (LocalReg, CmmExpr)
-&gt; ((LocalReg, CmmExpr), (LocalReg, CmmExpr))
</span><a href="#local-6989586621681050892"><span class="hs-identifier hs-var hs-var">split</span></a></span></span><span> </span><span id="local-6989586621681050891"><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621681050891"><span class="hs-identifier hs-var">uniq</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681050890"><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681050890"><span class="hs-identifier hs-var">reg</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681050889"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681050889"><span class="hs-identifier hs-var">rhs</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-403"></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681050888"><span class="hs-identifier hs-var">tmp</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681050889"><span class="hs-identifier hs-var">rhs</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681050890"><span class="hs-identifier hs-var">reg</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CmmReg -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmReg"><span class="hs-identifier hs-var">CmmReg</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LocalReg -&gt; CmmReg
</span><a href="GHC.Cmm.Expr.html#CmmLocal"><span class="hs-identifier hs-var">CmmLocal</span></a></span><span> </span><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681050888"><span class="hs-identifier hs-var">tmp</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-404"></span><span>          </span><span class="hs-keyword">where</span><span>
</span><span id="line-405"></span><span>            </span><span id="local-6989586621681050887"><span class="annot"><span class="annottext">rep :: CmmType
</span><a href="#local-6989586621681050887"><span class="hs-identifier hs-var hs-var">rep</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; CmmExpr -&gt; CmmType
</span><a href="GHC.Cmm.Expr.html#cmmExprType"><span class="hs-identifier hs-var">cmmExprType</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681050919"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681050889"><span class="hs-identifier hs-var">rhs</span></a></span><span>
</span><span id="line-406"></span><span>            </span><span id="local-6989586621681050888"><span class="annot"><span class="annottext">tmp :: LocalReg
</span><a href="#local-6989586621681050888"><span class="hs-identifier hs-var hs-var">tmp</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Unique -&gt; CmmType -&gt; LocalReg
</span><a href="GHC.Cmm.Expr.html#LocalReg"><span class="hs-identifier hs-var">LocalReg</span></a></span><span> </span><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621681050891"><span class="hs-identifier hs-var">uniq</span></a></span><span> </span><span class="annot"><span class="annottext">CmmType
</span><a href="#local-6989586621681050887"><span class="hs-identifier hs-var">rep</span></a></span><span>
</span><span id="line-407"></span><span>
</span><span id="line-408"></span><span>        </span><span class="annot"><a href="#local-6989586621681050901"><span class="hs-identifier hs-type">mk_graph</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Utils.html#Stmt"><span class="hs-identifier hs-type">Stmt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-409"></span><span>        </span><span id="local-6989586621681050901"><span class="annot"><span class="annottext">mk_graph :: (LocalReg, CmmExpr) -&gt; FCode ()
</span><a href="#local-6989586621681050901"><span class="hs-identifier hs-var hs-var">mk_graph</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681050886"><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681050886"><span class="hs-identifier hs-var">reg</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681050885"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681050885"><span class="hs-identifier hs-var">rhs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmReg -&gt; CmmExpr -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#emitAssign"><span class="hs-identifier hs-var">emitAssign</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LocalReg -&gt; CmmReg
</span><a href="GHC.Cmm.Expr.html#CmmLocal"><span class="hs-identifier hs-var">CmmLocal</span></a></span><span> </span><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681050886"><span class="hs-identifier hs-var">reg</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681050885"><span class="hs-identifier hs-var">rhs</span></a></span><span>
</span><span id="line-410"></span><span>
</span><span id="line-411"></span><span>        </span><span class="annot"><a href="#local-6989586621681050905"><span class="hs-identifier hs-type">mustFollow</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Utils.html#Stmt"><span class="hs-identifier hs-type">Stmt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Utils.html#Stmt"><span class="hs-identifier hs-type">Stmt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-412"></span><span>        </span><span class="hs-special">(</span><span id="local-6989586621681050884"><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681050884"><span class="hs-identifier hs-var">reg</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681050905"><span class="annot"><span class="annottext">mustFollow :: (LocalReg, CmmExpr) -&gt; (LocalReg, CmmExpr) -&gt; Bool
</span><a href="#local-6989586621681050905"><span class="hs-operator hs-var hs-var">`mustFollow`</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LocalReg
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681050883"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681050883"><span class="hs-identifier hs-var">rhs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; CmmReg -&gt; CmmExpr -&gt; Bool
</span><a href="GHC.Cmm.Utils.html#regUsedIn"><span class="hs-identifier hs-var">regUsedIn</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681050919"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LocalReg -&gt; CmmReg
</span><a href="GHC.Cmm.Expr.html#CmmLocal"><span class="hs-identifier hs-var">CmmLocal</span></a></span><span> </span><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681050884"><span class="hs-identifier hs-var">reg</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681050883"><span class="hs-identifier hs-var">rhs</span></a></span><span>
</span><span id="line-413"></span><span>
</span><span id="line-414"></span><span class="hs-comment">-------------------------------------------------------------------------</span><span>
</span><span id="line-415"></span><span class="hs-comment">--      mkSwitch</span><span>
</span><span id="line-416"></span><span class="hs-comment">-------------------------------------------------------------------------</span><span>
</span><span id="line-417"></span><span>
</span><span id="line-418"></span><span>
</span><span id="line-419"></span><span class="annot"><a href="GHC.StgToCmm.Utils.html#emitSwitch"><span class="hs-identifier hs-type">emitSwitch</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span>                      </span><span class="hs-comment">-- Tag to switch on</span><span>
</span><span id="line-420"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Basic.html#ConTagZ"><span class="hs-identifier hs-type">ConTagZ</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Graph.html#CmmAGraphScoped"><span class="hs-identifier hs-type">CmmAGraphScoped</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-comment">-- Tagged branches</span><span>
</span><span id="line-421"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Graph.html#CmmAGraphScoped"><span class="hs-identifier hs-type">CmmAGraphScoped</span></a></span><span>        </span><span class="hs-comment">-- Default branch (if any)</span><span>
</span><span id="line-422"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#ConTagZ"><span class="hs-identifier hs-type">ConTagZ</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#ConTagZ"><span class="hs-identifier hs-type">ConTagZ</span></a></span><span>           </span><span class="hs-comment">-- Min and Max possible values;</span><span>
</span><span id="line-423"></span><span>                                           </span><span class="hs-comment">-- behaviour outside this range is</span><span>
</span><span id="line-424"></span><span>                                           </span><span class="hs-comment">-- undefined</span><span>
</span><span id="line-425"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-426"></span><span>
</span><span id="line-427"></span><span class="hs-comment">-- First, two rather common cases in which there is no work to do</span><span>
</span><span id="line-428"></span><span id="emitSwitch"><span class="annot"><span class="annottext">emitSwitch :: CmmExpr
-&gt; [(Key, CmmAGraphScoped)]
-&gt; Maybe CmmAGraphScoped
-&gt; Key
-&gt; Key
-&gt; FCode ()
</span><a href="GHC.StgToCmm.Utils.html#emitSwitch"><span class="hs-identifier hs-var hs-var">emitSwitch</span></a></span></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>         </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681050880"><span class="annot"><span class="annottext">CmmAGraphScoped
</span><a href="#local-6989586621681050880"><span class="hs-identifier hs-var">code</span></a></span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Key
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Key
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmAGraph -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#emit"><span class="hs-identifier hs-var">emit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmAGraphScoped -&gt; CmmAGraph
forall a b. (a, b) -&gt; a
</span><a href="../../base/src/Data.Tuple.html#fst"><span class="hs-identifier hs-var">fst</span></a></span><span> </span><span class="annot"><span class="annottext">CmmAGraphScoped
</span><a href="#local-6989586621681050880"><span class="hs-identifier hs-var">code</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-429"></span><span class="annot"><a href="GHC.StgToCmm.Utils.html#emitSwitch"><span class="hs-identifier hs-var">emitSwitch</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Key
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span id="local-6989586621681050879"><span class="annot"><span class="annottext">CmmAGraphScoped
</span><a href="#local-6989586621681050879"><span class="hs-identifier hs-var">code</span></a></span></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">Maybe CmmAGraphScoped
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>     </span><span class="annot"><span class="annottext">Key
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Key
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmAGraph -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#emit"><span class="hs-identifier hs-var">emit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmAGraphScoped -&gt; CmmAGraph
forall a b. (a, b) -&gt; a
</span><a href="../../base/src/Data.Tuple.html#fst"><span class="hs-identifier hs-var">fst</span></a></span><span> </span><span class="annot"><span class="annottext">CmmAGraphScoped
</span><a href="#local-6989586621681050879"><span class="hs-identifier hs-var">code</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-430"></span><span>
</span><span id="line-431"></span><span class="hs-comment">-- Right, off we go</span><span>
</span><span id="line-432"></span><span class="annot"><a href="GHC.StgToCmm.Utils.html#emitSwitch"><span class="hs-identifier hs-var">emitSwitch</span></a></span><span> </span><span id="local-6989586621681050878"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681050878"><span class="hs-identifier hs-var">tag_expr</span></a></span></span><span> </span><span id="local-6989586621681050877"><span class="annot"><span class="annottext">[(Key, CmmAGraphScoped)]
</span><a href="#local-6989586621681050877"><span class="hs-identifier hs-var">branches</span></a></span></span><span> </span><span id="local-6989586621681050876"><span class="annot"><span class="annottext">Maybe CmmAGraphScoped
</span><a href="#local-6989586621681050876"><span class="hs-identifier hs-var">mb_deflt</span></a></span></span><span> </span><span id="local-6989586621681050875"><span class="annot"><span class="annottext">Key
</span><a href="#local-6989586621681050875"><span class="hs-identifier hs-var">lo_tag</span></a></span></span><span> </span><span id="local-6989586621681050874"><span class="annot"><span class="annottext">Key
</span><a href="#local-6989586621681050874"><span class="hs-identifier hs-var">hi_tag</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-433"></span><span>    </span><span id="local-6989586621681050873"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681050873"><span class="hs-identifier hs-var">join_lbl</span></a></span></span><span>      </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode BlockId
forall (m :: * -&gt; *). MonadUnique m =&gt; m BlockId
</span><a href="GHC.Cmm.BlockId.html#newBlockId"><span class="hs-identifier hs-var">newBlockId</span></a></span><span>
</span><span id="line-434"></span><span>    </span><span id="local-6989586621681050871"><span class="annot"><span class="annottext">Maybe BlockId
</span><a href="#local-6989586621681050871"><span class="hs-identifier hs-var">mb_deflt_lbl</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">BlockId -&gt; Maybe CmmAGraphScoped -&gt; FCode (Maybe BlockId)
</span><a href="GHC.StgToCmm.Utils.html#label_default"><span class="hs-identifier hs-var">label_default</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681050873"><span class="hs-identifier hs-var">join_lbl</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe CmmAGraphScoped
</span><a href="#local-6989586621681050876"><span class="hs-identifier hs-var">mb_deflt</span></a></span><span>
</span><span id="line-435"></span><span>    </span><span id="local-6989586621681050869"><span class="annot"><span class="annottext">[(Key, BlockId)]
</span><a href="#local-6989586621681050869"><span class="hs-identifier hs-var">branches_lbls</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">BlockId -&gt; [(Key, CmmAGraphScoped)] -&gt; FCode [(Key, BlockId)]
forall a. BlockId -&gt; [(a, CmmAGraphScoped)] -&gt; FCode [(a, BlockId)]
</span><a href="GHC.StgToCmm.Utils.html#label_branches"><span class="hs-identifier hs-var">label_branches</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681050873"><span class="hs-identifier hs-var">join_lbl</span></a></span><span> </span><span class="annot"><span class="annottext">[(Key, CmmAGraphScoped)]
</span><a href="#local-6989586621681050877"><span class="hs-identifier hs-var">branches</span></a></span><span>
</span><span id="line-436"></span><span>    </span><span id="local-6989586621681050867"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681050867"><span class="hs-identifier hs-var">tag_expr'</span></a></span></span><span>     </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CmmExpr -&gt; FCode CmmExpr
</span><a href="GHC.StgToCmm.Utils.html#assignTemp%27"><span class="hs-identifier hs-var">assignTemp'</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681050878"><span class="hs-identifier hs-var">tag_expr</span></a></span><span>
</span><span id="line-437"></span><span>
</span><span id="line-438"></span><span>    </span><span class="hs-comment">-- Sort the branches before calling mk_discrete_switch</span><span>
</span><span id="line-439"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681050861"><span class="annot"><span class="annottext">branches_lbls' :: [(Integer, BlockId)]
</span><a href="#local-6989586621681050861"><span class="hs-identifier hs-var hs-var">branches_lbls'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Key -&gt; Integer
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">Key
</span><a href="#local-6989586621681050860"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681050859"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681050860"><span class="annot"><span class="annottext">Key
</span><a href="#local-6989586621681050860"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681050859"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681050859"><span class="hs-identifier hs-var">l</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">((Key, BlockId) -&gt; (Key, BlockId) -&gt; Ordering)
-&gt; [(Key, BlockId)] -&gt; [(Key, BlockId)]
forall a. (a -&gt; a -&gt; Ordering) -&gt; [a] -&gt; [a]
</span><a href="../../base/src/Data.OldList.html#sortBy"><span class="hs-identifier hs-var">sortBy</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">((Key, BlockId) -&gt; Key)
-&gt; (Key, BlockId) -&gt; (Key, BlockId) -&gt; Ordering
forall a b. Ord a =&gt; (b -&gt; a) -&gt; b -&gt; b -&gt; Ordering
</span><a href="../../base/src/Data.Ord.html#comparing"><span class="hs-identifier hs-var">comparing</span></a></span><span> </span><span class="annot"><span class="annottext">(Key, BlockId) -&gt; Key
forall a b. (a, b) -&gt; a
</span><a href="../../base/src/Data.Tuple.html#fst"><span class="hs-identifier hs-var">fst</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[(Key, BlockId)]
</span><a href="#local-6989586621681050869"><span class="hs-identifier hs-var">branches_lbls</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-440"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681050852"><span class="annot"><span class="annottext">range :: (Integer, Integer)
</span><a href="#local-6989586621681050852"><span class="hs-identifier hs-var hs-var">range</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Key -&gt; Integer
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">Key
</span><a href="#local-6989586621681050875"><span class="hs-identifier hs-var">lo_tag</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Key -&gt; Integer
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">Key
</span><a href="#local-6989586621681050874"><span class="hs-identifier hs-var">hi_tag</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-441"></span><span>
</span><span id="line-442"></span><span>    </span><span class="annot"><span class="annottext">CmmAGraph -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#emit"><span class="hs-identifier hs-var">emit</span></a></span><span> </span><span class="annot"><span class="annottext">(CmmAGraph -&gt; FCode ()) -&gt; CmmAGraph -&gt; FCode ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
-&gt; CmmExpr
-&gt; [(Integer, BlockId)]
-&gt; Maybe BlockId
-&gt; (Integer, Integer)
-&gt; CmmAGraph
</span><a href="GHC.StgToCmm.Utils.html#mk_discrete_switch"><span class="hs-identifier hs-var">mk_discrete_switch</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681050867"><span class="hs-identifier hs-var">tag_expr'</span></a></span><span> </span><span class="annot"><span class="annottext">[(Integer, BlockId)]
</span><a href="#local-6989586621681050861"><span class="hs-identifier hs-var">branches_lbls'</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe BlockId
</span><a href="#local-6989586621681050871"><span class="hs-identifier hs-var">mb_deflt_lbl</span></a></span><span> </span><span class="annot"><span class="annottext">(Integer, Integer)
</span><a href="#local-6989586621681050852"><span class="hs-identifier hs-var">range</span></a></span><span>
</span><span id="line-443"></span><span>
</span><span id="line-444"></span><span>    </span><span class="annot"><span class="annottext">BlockId -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#emitLabel"><span class="hs-identifier hs-var">emitLabel</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681050873"><span class="hs-identifier hs-var">join_lbl</span></a></span><span>
</span><span id="line-445"></span><span>
</span><span id="line-446"></span><span class="annot"><a href="GHC.StgToCmm.Utils.html#mk_discrete_switch"><span class="hs-identifier hs-type">mk_discrete_switch</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-comment">-- ^ Use signed comparisons</span><span>
</span><span id="line-447"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span>
</span><span id="line-448"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Integer</span></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.BlockId.html#BlockId"><span class="hs-identifier hs-type">BlockId</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-449"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.BlockId.html#BlockId"><span class="hs-identifier hs-type">BlockId</span></a></span><span>
</span><span id="line-450"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Integer</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Integer</span></span><span class="hs-special">)</span><span>
</span><span id="line-451"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Graph.html#CmmAGraph"><span class="hs-identifier hs-type">CmmAGraph</span></a></span><span>
</span><span id="line-452"></span><span>
</span><span id="line-453"></span><span class="hs-comment">-- SINGLETON TAG RANGE: no case analysis to do</span><span>
</span><span id="line-454"></span><span id="mk_discrete_switch"><span class="annot"><span class="annottext">mk_discrete_switch :: Bool
-&gt; CmmExpr
-&gt; [(Integer, BlockId)]
-&gt; Maybe BlockId
-&gt; (Integer, Integer)
-&gt; CmmAGraph
</span><a href="GHC.StgToCmm.Utils.html#mk_discrete_switch"><span class="hs-identifier hs-var hs-var">mk_discrete_switch</span></a></span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681050849"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681050849"><span class="hs-identifier hs-var">_tag_expr</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span id="local-6989586621681050848"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681050848"><span class="hs-identifier hs-var">tag</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681050847"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681050847"><span class="hs-identifier hs-var">lbl</span></a></span></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">Maybe BlockId
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681050846"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681050846"><span class="hs-identifier hs-var">lo_tag</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681050845"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681050845"><span class="hs-identifier hs-var">hi_tag</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-455"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681050846"><span class="hs-identifier hs-var">lo_tag</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681050845"><span class="hs-identifier hs-var">hi_tag</span></a></span><span>
</span><span id="line-456"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">ASSERT</span><span class="hs-special">(</span><span> </span><span class="hs-identifier">tag</span><span> </span><span class="hs-operator">==</span><span> </span><span class="hs-identifier">lo_tag</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-457"></span><span>    </span><span class="annot"><span class="annottext">BlockId -&gt; CmmAGraph
</span><a href="GHC.Cmm.Graph.html#mkBranch"><span class="hs-identifier hs-var">mkBranch</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681050847"><span class="hs-identifier hs-var">lbl</span></a></span><span>
</span><span id="line-458"></span><span>
</span><span id="line-459"></span><span class="hs-comment">-- SINGLETON BRANCH, NO DEFAULT: no case analysis to do</span><span>
</span><span id="line-460"></span><span class="annot"><a href="GHC.StgToCmm.Utils.html#mk_discrete_switch"><span class="hs-identifier hs-var">mk_discrete_switch</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681050843"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681050843"><span class="hs-identifier hs-var">_tag_expr</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span id="local-6989586621681050842"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681050842"><span class="hs-identifier hs-var">_tag</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681050841"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681050841"><span class="hs-identifier hs-var">lbl</span></a></span></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">Maybe BlockId
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="annot"><span class="annottext">(Integer, Integer)
</span><span class="hs-identifier">_</span></span><span>
</span><span id="line-461"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">BlockId -&gt; CmmAGraph
</span><a href="GHC.Cmm.Graph.html#mkBranch"><span class="hs-identifier hs-var">mkBranch</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681050841"><span class="hs-identifier hs-var">lbl</span></a></span><span>
</span><span id="line-462"></span><span>        </span><span class="hs-comment">-- The simplifier might have eliminated a case</span><span>
</span><span id="line-463"></span><span>        </span><span class="hs-comment">--       so we may have e.g. case xs of</span><span>
</span><span id="line-464"></span><span>        </span><span class="hs-comment">--                               [] -&gt; e</span><span>
</span><span id="line-465"></span><span>        </span><span class="hs-comment">-- In that situation we can be sure the (:) case</span><span>
</span><span id="line-466"></span><span>        </span><span class="hs-comment">-- can't happen, so no need to test</span><span>
</span><span id="line-467"></span><span>
</span><span id="line-468"></span><span class="hs-comment">-- SOMETHING MORE COMPLICATED: defer to GHC.Cmm.Switch.Implement</span><span>
</span><span id="line-469"></span><span class="hs-comment">-- See Note [Cmm Switches, the general plan] in GHC.Cmm.Switch</span><span>
</span><span id="line-470"></span><span class="annot"><a href="GHC.StgToCmm.Utils.html#mk_discrete_switch"><span class="hs-identifier hs-var">mk_discrete_switch</span></a></span><span> </span><span id="local-6989586621681050840"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681050840"><span class="hs-identifier hs-var">signed</span></a></span></span><span> </span><span id="local-6989586621681050839"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681050839"><span class="hs-identifier hs-var">tag_expr</span></a></span></span><span> </span><span id="local-6989586621681050838"><span class="annot"><span class="annottext">[(Integer, BlockId)]
</span><a href="#local-6989586621681050838"><span class="hs-identifier hs-var">branches</span></a></span></span><span> </span><span id="local-6989586621681050837"><span class="annot"><span class="annottext">Maybe BlockId
</span><a href="#local-6989586621681050837"><span class="hs-identifier hs-var">mb_deflt</span></a></span></span><span> </span><span id="local-6989586621681050836"><span class="annot"><span class="annottext">(Integer, Integer)
</span><a href="#local-6989586621681050836"><span class="hs-identifier hs-var">range</span></a></span></span><span>
</span><span id="line-471"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmExpr -&gt; SwitchTargets -&gt; CmmAGraph
</span><a href="GHC.Cmm.Graph.html#mkSwitch"><span class="hs-identifier hs-var">mkSwitch</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681050839"><span class="hs-identifier hs-var">tag_expr</span></a></span><span> </span><span class="annot"><span class="annottext">(SwitchTargets -&gt; CmmAGraph) -&gt; SwitchTargets -&gt; CmmAGraph
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
-&gt; (Integer, Integer)
-&gt; Maybe BlockId
-&gt; Map Integer BlockId
-&gt; SwitchTargets
</span><a href="GHC.Cmm.Switch.html#mkSwitchTargets"><span class="hs-identifier hs-var">mkSwitchTargets</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681050840"><span class="hs-identifier hs-var">signed</span></a></span><span> </span><span class="annot"><span class="annottext">(Integer, Integer)
</span><a href="#local-6989586621681050836"><span class="hs-identifier hs-var">range</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe BlockId
</span><a href="#local-6989586621681050837"><span class="hs-identifier hs-var">mb_deflt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[(Integer, BlockId)] -&gt; Map Integer BlockId
forall k a. Ord k =&gt; [(k, a)] -&gt; Map k a
</span><a href="../../containers/src/Data.Map.Internal.html#fromList"><span class="hs-identifier hs-var">M.fromList</span></a></span><span> </span><span class="annot"><span class="annottext">[(Integer, BlockId)]
</span><a href="#local-6989586621681050838"><span class="hs-identifier hs-var">branches</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-472"></span><span>
</span><span id="line-473"></span><span id="local-6989586621681051301"><span id="local-6989586621681051302"><span class="annot"><a href="GHC.StgToCmm.Utils.html#divideBranches"><span class="hs-identifier hs-type">divideBranches</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Ord</span></span><span> </span><span class="annot"><a href="#local-6989586621681051302"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681051302"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621681051301"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681051302"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621681051301"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621681051302"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681051302"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621681051301"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-special">)</span></span></span><span>
</span><span id="line-474"></span><span id="divideBranches"><span class="annot"><span class="annottext">divideBranches :: forall a b. Ord a =&gt; [(a, b)] -&gt; ([(a, b)], a, [(a, b)])
</span><a href="GHC.StgToCmm.Utils.html#divideBranches"><span class="hs-identifier hs-var hs-var">divideBranches</span></a></span></span><span> </span><span id="local-6989586621681050830"><span class="annot"><span class="annottext">[(a, b)]
</span><a href="#local-6989586621681050830"><span class="hs-identifier hs-var">branches</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[(a, b)]
</span><a href="#local-6989586621681050829"><span class="hs-identifier hs-var">lo_branches</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681050828"><span class="hs-identifier hs-var">mid</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[(a, b)]
</span><a href="#local-6989586621681050827"><span class="hs-identifier hs-var">hi_branches</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-475"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-476"></span><span>    </span><span class="hs-comment">-- 2 branches =&gt; n_branches `div` 2 = 1</span><span>
</span><span id="line-477"></span><span>    </span><span class="hs-comment">--            =&gt; branches !! 1 give the *second* tag</span><span>
</span><span id="line-478"></span><span>    </span><span class="hs-comment">-- There are always at least 2 branches here</span><span>
</span><span id="line-479"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681050828"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681050828"><span class="hs-identifier hs-var">mid</span></a></span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">b
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(a, b)]
</span><a href="#local-6989586621681050830"><span class="hs-identifier hs-var">branches</span></a></span><span> </span><span class="annot"><span class="annottext">[(a, b)] -&gt; Key -&gt; (a, b)
forall a. [a] -&gt; Key -&gt; a
</span><a href="../../base/src/GHC.List.html#%21%21"><span class="hs-operator hs-var">!!</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[(a, b)] -&gt; Key
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Key
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">[(a, b)]
</span><a href="#local-6989586621681050830"><span class="hs-identifier hs-var">branches</span></a></span><span> </span><span class="annot"><span class="annottext">Key -&gt; Key -&gt; Key
forall a. Integral a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Real.html#div"><span class="hs-operator hs-var">`div`</span></a></span><span> </span><span class="annot"><span class="annottext">Key
</span><span class="hs-number">2</span></span><span class="hs-special">)</span><span>
</span><span id="line-480"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681050829"><span class="annot"><span class="annottext">[(a, b)]
</span><a href="#local-6989586621681050829"><span class="hs-identifier hs-var">lo_branches</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681050827"><span class="annot"><span class="annottext">[(a, b)]
</span><a href="#local-6989586621681050827"><span class="hs-identifier hs-var">hi_branches</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((a, b) -&gt; Bool) -&gt; [(a, b)] -&gt; ([(a, b)], [(a, b)])
forall a. (a -&gt; Bool) -&gt; [a] -&gt; ([a], [a])
</span><a href="../../base/src/GHC.List.html#span"><span class="hs-identifier hs-var">span</span></a></span><span> </span><span class="annot"><span class="annottext">(a, b) -&gt; Bool
forall {b}. (a, b) -&gt; Bool
</span><a href="#local-6989586621681050819"><span class="hs-identifier hs-var">is_lo</span></a></span><span> </span><span class="annot"><span class="annottext">[(a, b)]
</span><a href="#local-6989586621681050830"><span class="hs-identifier hs-var">branches</span></a></span><span>
</span><span id="line-481"></span><span>    </span><span id="local-6989586621681050819"><span class="annot"><span class="annottext">is_lo :: (a, b) -&gt; Bool
</span><a href="#local-6989586621681050819"><span class="hs-identifier hs-var hs-var">is_lo</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681050817"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681050817"><span class="hs-identifier hs-var">t</span></a></span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">b
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681050817"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;</span></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681050828"><span class="hs-identifier hs-var">mid</span></a></span><span>
</span><span id="line-482"></span><span>
</span><span id="line-483"></span><span class="hs-comment">--------------</span><span>
</span><span id="line-484"></span><span class="annot"><a href="GHC.StgToCmm.Utils.html#emitCmmLitSwitch"><span class="hs-identifier hs-type">emitCmmLitSwitch</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span>                    </span><span class="hs-comment">-- Tag to switch on</span><span>
</span><span id="line-485"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Literal.html#Literal"><span class="hs-identifier hs-type">Literal</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Graph.html#CmmAGraphScoped"><span class="hs-identifier hs-type">CmmAGraphScoped</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-comment">-- Tagged branches</span><span>
</span><span id="line-486"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Graph.html#CmmAGraphScoped"><span class="hs-identifier hs-type">CmmAGraphScoped</span></a></span><span>              </span><span class="hs-comment">-- Default branch (always)</span><span>
</span><span id="line-487"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>                     </span><span class="hs-comment">-- Emit the code</span><span>
</span><span id="line-488"></span><span id="emitCmmLitSwitch"><span class="annot"><span class="annottext">emitCmmLitSwitch :: CmmExpr
-&gt; [(Literal, CmmAGraphScoped)] -&gt; CmmAGraphScoped -&gt; FCode ()
</span><a href="GHC.StgToCmm.Utils.html#emitCmmLitSwitch"><span class="hs-identifier hs-var hs-var">emitCmmLitSwitch</span></a></span></span><span> </span><span id="local-6989586621681050815"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681050815"><span class="hs-identifier hs-var">_scrut</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>       </span><span id="local-6989586621681050814"><span class="annot"><span class="annottext">CmmAGraphScoped
</span><a href="#local-6989586621681050814"><span class="hs-identifier hs-var">deflt</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmAGraph -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#emit"><span class="hs-identifier hs-var">emit</span></a></span><span> </span><span class="annot"><span class="annottext">(CmmAGraph -&gt; FCode ()) -&gt; CmmAGraph -&gt; FCode ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">CmmAGraphScoped -&gt; CmmAGraph
forall a b. (a, b) -&gt; a
</span><a href="../../base/src/Data.Tuple.html#fst"><span class="hs-identifier hs-var">fst</span></a></span><span> </span><span class="annot"><span class="annottext">CmmAGraphScoped
</span><a href="#local-6989586621681050814"><span class="hs-identifier hs-var">deflt</span></a></span><span>
</span><span id="line-489"></span><span class="annot"><a href="GHC.StgToCmm.Utils.html#emitCmmLitSwitch"><span class="hs-identifier hs-var">emitCmmLitSwitch</span></a></span><span> </span><span id="local-6989586621681050813"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681050813"><span class="hs-identifier hs-var">scrut</span></a></span></span><span>  </span><span id="local-6989586621681050812"><span class="annot"><span class="annottext">[(Literal, CmmAGraphScoped)]
</span><a href="#local-6989586621681050812"><span class="hs-identifier hs-var">branches</span></a></span></span><span> </span><span id="local-6989586621681050811"><span class="annot"><span class="annottext">CmmAGraphScoped
</span><a href="#local-6989586621681050811"><span class="hs-identifier hs-var">deflt</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-490"></span><span>    </span><span id="local-6989586621681050810"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681050810"><span class="hs-identifier hs-var">scrut'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CmmExpr -&gt; FCode CmmExpr
</span><a href="GHC.StgToCmm.Utils.html#assignTemp%27"><span class="hs-identifier hs-var">assignTemp'</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681050813"><span class="hs-identifier hs-var">scrut</span></a></span><span>
</span><span id="line-491"></span><span>    </span><span id="local-6989586621681050809"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681050809"><span class="hs-identifier hs-var">join_lbl</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode BlockId
forall (m :: * -&gt; *). MonadUnique m =&gt; m BlockId
</span><a href="GHC.Cmm.BlockId.html#newBlockId"><span class="hs-identifier hs-var">newBlockId</span></a></span><span>
</span><span id="line-492"></span><span>    </span><span id="local-6989586621681050808"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681050808"><span class="hs-identifier hs-var">deflt_lbl</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">BlockId -&gt; CmmAGraphScoped -&gt; FCode BlockId
</span><a href="GHC.StgToCmm.Utils.html#label_code"><span class="hs-identifier hs-var">label_code</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681050809"><span class="hs-identifier hs-var">join_lbl</span></a></span><span> </span><span class="annot"><span class="annottext">CmmAGraphScoped
</span><a href="#local-6989586621681050811"><span class="hs-identifier hs-var">deflt</span></a></span><span>
</span><span id="line-493"></span><span>    </span><span id="local-6989586621681050806"><span class="annot"><span class="annottext">[(Literal, BlockId)]
</span><a href="#local-6989586621681050806"><span class="hs-identifier hs-var">branches_lbls</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">BlockId
-&gt; [(Literal, CmmAGraphScoped)] -&gt; FCode [(Literal, BlockId)]
forall a. BlockId -&gt; [(a, CmmAGraphScoped)] -&gt; FCode [(a, BlockId)]
</span><a href="GHC.StgToCmm.Utils.html#label_branches"><span class="hs-identifier hs-var">label_branches</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681050809"><span class="hs-identifier hs-var">join_lbl</span></a></span><span> </span><span class="annot"><span class="annottext">[(Literal, CmmAGraphScoped)]
</span><a href="#local-6989586621681050812"><span class="hs-identifier hs-var">branches</span></a></span><span>
</span><span id="line-494"></span><span>
</span><span id="line-495"></span><span>    </span><span id="local-6989586621681050805"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681050805"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode Platform
</span><a href="GHC.StgToCmm.Monad.html#getPlatform"><span class="hs-identifier hs-var">getPlatform</span></a></span><span>
</span><span id="line-496"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681050804"><span class="annot"><span class="annottext">cmm_ty :: CmmType
</span><a href="#local-6989586621681050804"><span class="hs-identifier hs-var hs-var">cmm_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; CmmExpr -&gt; CmmType
</span><a href="GHC.Cmm.Expr.html#cmmExprType"><span class="hs-identifier hs-var">cmmExprType</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681050805"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681050813"><span class="hs-identifier hs-var">scrut</span></a></span><span>
</span><span id="line-497"></span><span>        </span><span id="local-6989586621681050803"><span class="annot"><span class="annottext">rep :: Width
</span><a href="#local-6989586621681050803"><span class="hs-identifier hs-var hs-var">rep</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmType -&gt; Width
</span><a href="GHC.Cmm.Type.html#typeWidth"><span class="hs-identifier hs-var">typeWidth</span></a></span><span> </span><span class="annot"><span class="annottext">CmmType
</span><a href="#local-6989586621681050804"><span class="hs-identifier hs-var">cmm_ty</span></a></span><span>
</span><span id="line-498"></span><span>
</span><span id="line-499"></span><span>    </span><span class="hs-comment">-- We find the necessary type information in the literals in the branches</span><span>
</span><span id="line-500"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681050802"><span class="annot"><span class="annottext">signed :: Bool
</span><a href="#local-6989586621681050802"><span class="hs-identifier hs-var hs-var">signed</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">[(Literal, CmmAGraphScoped)] -&gt; (Literal, CmmAGraphScoped)
forall a. [a] -&gt; a
</span><a href="../../base/src/GHC.List.html#head"><span class="hs-identifier hs-var">head</span></a></span><span> </span><span class="annot"><span class="annottext">[(Literal, CmmAGraphScoped)]
</span><a href="#local-6989586621681050812"><span class="hs-identifier hs-var">branches</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-501"></span><span>                    </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Literal.html#LitNumber"><span class="hs-identifier hs-type">LitNumber</span></a></span><span> </span><span id="local-6989586621681050800"><span class="annot"><span class="annottext">LitNumType
</span><a href="#local-6989586621681050800"><span class="hs-identifier hs-var">nt</span></a></span></span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CmmAGraphScoped
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">LitNumType -&gt; Bool
</span><a href="GHC.Types.Literal.html#litNumIsSigned"><span class="hs-identifier hs-var">litNumIsSigned</span></a></span><span> </span><span class="annot"><span class="annottext">LitNumType
</span><a href="#local-6989586621681050800"><span class="hs-identifier hs-var">nt</span></a></span><span>
</span><span id="line-502"></span><span>                    </span><span class="annot"><span class="annottext">(Literal, CmmAGraphScoped)
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-503"></span><span>
</span><span id="line-504"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681050797"><span class="annot"><span class="annottext">range :: (Integer, Integer)
</span><a href="#local-6989586621681050797"><span class="hs-identifier hs-var hs-var">range</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681050802"><span class="hs-identifier hs-var">signed</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; Integer
</span><a href="../../ghc-boot/src/GHC.Platform.html#platformMinInt"><span class="hs-identifier hs-var">platformMinInt</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681050805"><span class="hs-identifier hs-var">platform</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; Integer
</span><a href="../../ghc-boot/src/GHC.Platform.html#platformMaxInt"><span class="hs-identifier hs-var">platformMaxInt</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681050805"><span class="hs-identifier hs-var">platform</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-505"></span><span>              </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">0</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; Integer
</span><a href="../../ghc-boot/src/GHC.Platform.html#platformMaxWord"><span class="hs-identifier hs-var">platformMaxWord</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681050805"><span class="hs-identifier hs-var">platform</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-506"></span><span>
</span><span id="line-507"></span><span>    </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">CmmType -&gt; Bool
</span><a href="GHC.Cmm.Type.html#isFloatType"><span class="hs-identifier hs-var">isFloatType</span></a></span><span> </span><span class="annot"><span class="annottext">CmmType
</span><a href="#local-6989586621681050804"><span class="hs-identifier hs-var">cmm_ty</span></a></span><span>
</span><span id="line-508"></span><span>    </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">CmmAGraph -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#emit"><span class="hs-identifier hs-var">emit</span></a></span><span> </span><span class="annot"><span class="annottext">(CmmAGraph -&gt; FCode ()) -&gt; FCode CmmAGraph -&gt; FCode ()
forall (m :: * -&gt; *) a b. Monad m =&gt; (a -&gt; m b) -&gt; m a -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3D%3C%3C"><span class="hs-operator hs-var">=&lt;&lt;</span></a></span><span> </span><span class="annot"><span class="annottext">Width
-&gt; CmmExpr
-&gt; BlockId
-&gt; LitBound
-&gt; [(Literal, BlockId)]
-&gt; FCode CmmAGraph
</span><a href="GHC.StgToCmm.Utils.html#mk_float_switch"><span class="hs-identifier hs-var">mk_float_switch</span></a></span><span> </span><span class="annot"><span class="annottext">Width
</span><a href="#local-6989586621681050803"><span class="hs-identifier hs-var">rep</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681050810"><span class="hs-identifier hs-var">scrut'</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681050808"><span class="hs-identifier hs-var">deflt_lbl</span></a></span><span> </span><span class="annot"><span class="annottext">LitBound
</span><a href="GHC.StgToCmm.Utils.html#noBound"><span class="hs-identifier hs-var">noBound</span></a></span><span> </span><span class="annot"><span class="annottext">[(Literal, BlockId)]
</span><a href="#local-6989586621681050806"><span class="hs-identifier hs-var">branches_lbls</span></a></span><span>
</span><span id="line-509"></span><span>    </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">CmmAGraph -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#emit"><span class="hs-identifier hs-var">emit</span></a></span><span> </span><span class="annot"><span class="annottext">(CmmAGraph -&gt; FCode ()) -&gt; CmmAGraph -&gt; FCode ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
-&gt; CmmExpr
-&gt; [(Integer, BlockId)]
-&gt; Maybe BlockId
-&gt; (Integer, Integer)
-&gt; CmmAGraph
</span><a href="GHC.StgToCmm.Utils.html#mk_discrete_switch"><span class="hs-identifier hs-var">mk_discrete_switch</span></a></span><span>
</span><span id="line-510"></span><span>        </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681050802"><span class="hs-identifier hs-var">signed</span></a></span><span>
</span><span id="line-511"></span><span>        </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681050810"><span class="hs-identifier hs-var">scrut'</span></a></span><span>
</span><span id="line-512"></span><span>        </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Literal -&gt; Integer
</span><a href="GHC.Types.Literal.html#litValue"><span class="hs-identifier hs-var">litValue</span></a></span><span> </span><span class="annot"><span class="annottext">Literal
</span><a href="#local-6989586621681050789"><span class="hs-identifier hs-var">lit</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681050788"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681050789"><span class="annot"><span class="annottext">Literal
</span><a href="#local-6989586621681050789"><span class="hs-identifier hs-var">lit</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681050788"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681050788"><span class="hs-identifier hs-var">l</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[(Literal, BlockId)]
</span><a href="#local-6989586621681050806"><span class="hs-identifier hs-var">branches_lbls</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-513"></span><span>        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BlockId -&gt; Maybe BlockId
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681050808"><span class="hs-identifier hs-var">deflt_lbl</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-514"></span><span>        </span><span class="annot"><span class="annottext">(Integer, Integer)
</span><a href="#local-6989586621681050797"><span class="hs-identifier hs-var">range</span></a></span><span>
</span><span id="line-515"></span><span>    </span><span class="annot"><span class="annottext">BlockId -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#emitLabel"><span class="hs-identifier hs-var">emitLabel</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681050809"><span class="hs-identifier hs-var">join_lbl</span></a></span><span>
</span><span id="line-516"></span><span>
</span><span id="line-517"></span><span class="hs-comment">-- | lower bound (inclusive), upper bound (exclusive)</span><span>
</span><span id="line-518"></span><span class="hs-keyword">type</span><span> </span><span id="LitBound"><span class="annot"><a href="GHC.StgToCmm.Utils.html#LitBound"><span class="hs-identifier hs-var">LitBound</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Literal.html#Literal"><span class="hs-identifier hs-type">Literal</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Literal.html#Literal"><span class="hs-identifier hs-type">Literal</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-519"></span><span>
</span><span id="line-520"></span><span class="annot"><a href="GHC.StgToCmm.Utils.html#noBound"><span class="hs-identifier hs-type">noBound</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Utils.html#LitBound"><span class="hs-identifier hs-type">LitBound</span></a></span><span>
</span><span id="line-521"></span><span id="noBound"><span class="annot"><span class="annottext">noBound :: LitBound
</span><a href="GHC.StgToCmm.Utils.html#noBound"><span class="hs-identifier hs-var hs-var">noBound</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe Literal
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Maybe Literal
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-522"></span><span>
</span><span id="line-523"></span><span class="annot"><a href="GHC.StgToCmm.Utils.html#mk_float_switch"><span class="hs-identifier hs-type">mk_float_switch</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Type.html#Width"><span class="hs-identifier hs-type">Width</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.BlockId.html#BlockId"><span class="hs-identifier hs-type">BlockId</span></a></span><span>
</span><span id="line-524"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Utils.html#LitBound"><span class="hs-identifier hs-type">LitBound</span></a></span><span>
</span><span id="line-525"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Literal.html#Literal"><span class="hs-identifier hs-type">Literal</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.Cmm.BlockId.html#BlockId"><span class="hs-identifier hs-type">BlockId</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-526"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Graph.html#CmmAGraph"><span class="hs-identifier hs-type">CmmAGraph</span></a></span><span>
</span><span id="line-527"></span><span id="mk_float_switch"><span class="annot"><span class="annottext">mk_float_switch :: Width
-&gt; CmmExpr
-&gt; BlockId
-&gt; LitBound
-&gt; [(Literal, BlockId)]
-&gt; FCode CmmAGraph
</span><a href="GHC.StgToCmm.Utils.html#mk_float_switch"><span class="hs-identifier hs-var hs-var">mk_float_switch</span></a></span></span><span> </span><span id="local-6989586621681050787"><span class="annot"><span class="annottext">Width
</span><a href="#local-6989586621681050787"><span class="hs-identifier hs-var">rep</span></a></span></span><span> </span><span id="local-6989586621681050786"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681050786"><span class="hs-identifier hs-var">scrut</span></a></span></span><span> </span><span id="local-6989586621681050785"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681050785"><span class="hs-identifier hs-var">deflt</span></a></span></span><span> </span><span id="local-6989586621681050784"><span class="annot"><span class="annottext">LitBound
</span><a href="#local-6989586621681050784"><span class="hs-identifier hs-var">_bounds</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span id="local-6989586621681050783"><span class="annot"><span class="annottext">Literal
</span><a href="#local-6989586621681050783"><span class="hs-identifier hs-var">lit</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681050782"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681050782"><span class="hs-identifier hs-var">blk</span></a></span></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-528"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621681050781"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681050781"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode Platform
</span><a href="GHC.StgToCmm.Monad.html#getPlatform"><span class="hs-identifier hs-var">getPlatform</span></a></span><span>
</span><span id="line-529"></span><span>       </span><span class="annot"><span class="annottext">CmmAGraph -&gt; FCode CmmAGraph
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(CmmAGraph -&gt; FCode CmmAGraph) -&gt; CmmAGraph -&gt; FCode CmmAGraph
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr -&gt; BlockId -&gt; BlockId -&gt; Maybe Bool -&gt; CmmAGraph
</span><a href="GHC.Cmm.Graph.html#mkCbranch"><span class="hs-identifier hs-var">mkCbranch</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; CmmExpr
</span><a href="#local-6989586621681050779"><span class="hs-identifier hs-var">cond</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681050781"><span class="hs-identifier hs-var">platform</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681050785"><span class="hs-identifier hs-var">deflt</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681050782"><span class="hs-identifier hs-var">blk</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Bool
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-530"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-531"></span><span>    </span><span id="local-6989586621681050779"><span class="annot"><span class="annottext">cond :: Platform -&gt; CmmExpr
</span><a href="#local-6989586621681050779"><span class="hs-identifier hs-var hs-var">cond</span></a></span></span><span> </span><span id="local-6989586621681050778"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681050778"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MachOp -&gt; [CmmExpr] -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmMachOp"><span class="hs-identifier hs-var">CmmMachOp</span></a></span><span> </span><span class="annot"><span class="annottext">MachOp
</span><a href="#local-6989586621681050777"><span class="hs-identifier hs-var">ne</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681050786"><span class="hs-identifier hs-var">scrut</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CmmLit -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmLit"><span class="hs-identifier hs-var">CmmLit</span></a></span><span> </span><span class="annot"><span class="annottext">CmmLit
</span><a href="#local-6989586621681050776"><span class="hs-identifier hs-var">cmm_lit</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-532"></span><span>      </span><span class="hs-keyword">where</span><span>
</span><span id="line-533"></span><span>        </span><span id="local-6989586621681050776"><span class="annot"><span class="annottext">cmm_lit :: CmmLit
</span><a href="#local-6989586621681050776"><span class="hs-identifier hs-var hs-var">cmm_lit</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; Literal -&gt; CmmLit
</span><a href="GHC.StgToCmm.Utils.html#mkSimpleLit"><span class="hs-identifier hs-var">mkSimpleLit</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681050778"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">Literal
</span><a href="#local-6989586621681050783"><span class="hs-identifier hs-var">lit</span></a></span><span>
</span><span id="line-534"></span><span>        </span><span id="local-6989586621681050777"><span class="annot"><span class="annottext">ne :: MachOp
</span><a href="#local-6989586621681050777"><span class="hs-identifier hs-var hs-var">ne</span></a></span></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Width -&gt; MachOp
</span><a href="GHC.Cmm.MachOp.html#MO_F_Ne"><span class="hs-identifier hs-var">MO_F_Ne</span></a></span><span> </span><span class="annot"><span class="annottext">Width
</span><a href="#local-6989586621681050787"><span class="hs-identifier hs-var">rep</span></a></span><span>
</span><span id="line-535"></span><span>
</span><span id="line-536"></span><span class="annot"><a href="GHC.StgToCmm.Utils.html#mk_float_switch"><span class="hs-identifier hs-var">mk_float_switch</span></a></span><span> </span><span id="local-6989586621681050774"><span class="annot"><span class="annottext">Width
</span><a href="#local-6989586621681050774"><span class="hs-identifier hs-var">rep</span></a></span></span><span> </span><span id="local-6989586621681050773"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681050773"><span class="hs-identifier hs-var">scrut</span></a></span></span><span> </span><span id="local-6989586621681050772"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681050772"><span class="hs-identifier hs-var">deflt_blk_id</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681050771"><span class="annot"><span class="annottext">Maybe Literal
</span><a href="#local-6989586621681050771"><span class="hs-identifier hs-var">lo_bound</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681050770"><span class="annot"><span class="annottext">Maybe Literal
</span><a href="#local-6989586621681050770"><span class="hs-identifier hs-var">hi_bound</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681050769"><span class="annot"><span class="annottext">[(Literal, BlockId)]
</span><a href="#local-6989586621681050769"><span class="hs-identifier hs-var">branches</span></a></span></span><span>
</span><span id="line-537"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621681050768"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681050768"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode Platform
</span><a href="GHC.StgToCmm.Monad.html#getPlatform"><span class="hs-identifier hs-var">getPlatform</span></a></span><span>
</span><span id="line-538"></span><span>       </span><span id="local-6989586621681050767"><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681050767"><span class="hs-identifier hs-var">lo_blk</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Width
-&gt; CmmExpr
-&gt; BlockId
-&gt; LitBound
-&gt; [(Literal, BlockId)]
-&gt; FCode CmmAGraph
</span><a href="GHC.StgToCmm.Utils.html#mk_float_switch"><span class="hs-identifier hs-var">mk_float_switch</span></a></span><span> </span><span class="annot"><span class="annottext">Width
</span><a href="#local-6989586621681050774"><span class="hs-identifier hs-var">rep</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681050773"><span class="hs-identifier hs-var">scrut</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681050772"><span class="hs-identifier hs-var">deflt_blk_id</span></a></span><span> </span><span class="annot"><span class="annottext">LitBound
</span><a href="#local-6989586621681050766"><span class="hs-identifier hs-var">bounds_lo</span></a></span><span> </span><span class="annot"><span class="annottext">[(Literal, BlockId)]
</span><a href="#local-6989586621681050765"><span class="hs-identifier hs-var">lo_branches</span></a></span><span>
</span><span id="line-539"></span><span>       </span><span id="local-6989586621681050764"><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681050764"><span class="hs-identifier hs-var">hi_blk</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Width
-&gt; CmmExpr
-&gt; BlockId
-&gt; LitBound
-&gt; [(Literal, BlockId)]
-&gt; FCode CmmAGraph
</span><a href="GHC.StgToCmm.Utils.html#mk_float_switch"><span class="hs-identifier hs-var">mk_float_switch</span></a></span><span> </span><span class="annot"><span class="annottext">Width
</span><a href="#local-6989586621681050774"><span class="hs-identifier hs-var">rep</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681050773"><span class="hs-identifier hs-var">scrut</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681050772"><span class="hs-identifier hs-var">deflt_blk_id</span></a></span><span> </span><span class="annot"><span class="annottext">LitBound
</span><a href="#local-6989586621681050763"><span class="hs-identifier hs-var">bounds_hi</span></a></span><span> </span><span class="annot"><span class="annottext">[(Literal, BlockId)]
</span><a href="#local-6989586621681050762"><span class="hs-identifier hs-var">hi_branches</span></a></span><span>
</span><span id="line-540"></span><span>       </span><span class="annot"><span class="annottext">CmmExpr -&gt; CmmAGraph -&gt; CmmAGraph -&gt; FCode CmmAGraph
</span><a href="GHC.StgToCmm.Monad.html#mkCmmIfThenElse"><span class="hs-identifier hs-var">mkCmmIfThenElse</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; CmmExpr
</span><a href="#local-6989586621681050760"><span class="hs-identifier hs-var">cond</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681050768"><span class="hs-identifier hs-var">platform</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681050767"><span class="hs-identifier hs-var">lo_blk</span></a></span><span> </span><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681050764"><span class="hs-identifier hs-var">hi_blk</span></a></span><span>
</span><span id="line-541"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-542"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681050765"><span class="annot"><span class="annottext">[(Literal, BlockId)]
</span><a href="#local-6989586621681050765"><span class="hs-identifier hs-var">lo_branches</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681050757"><span class="annot"><span class="annottext">Literal
</span><a href="#local-6989586621681050757"><span class="hs-identifier hs-var">mid_lit</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681050762"><span class="annot"><span class="annottext">[(Literal, BlockId)]
</span><a href="#local-6989586621681050762"><span class="hs-identifier hs-var">hi_branches</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(Literal, BlockId)]
-&gt; ([(Literal, BlockId)], Literal, [(Literal, BlockId)])
forall a b. Ord a =&gt; [(a, b)] -&gt; ([(a, b)], a, [(a, b)])
</span><a href="GHC.StgToCmm.Utils.html#divideBranches"><span class="hs-identifier hs-var">divideBranches</span></a></span><span> </span><span class="annot"><span class="annottext">[(Literal, BlockId)]
</span><a href="#local-6989586621681050769"><span class="hs-identifier hs-var">branches</span></a></span><span>
</span><span id="line-543"></span><span>
</span><span id="line-544"></span><span>    </span><span id="local-6989586621681050766"><span class="annot"><span class="annottext">bounds_lo :: LitBound
</span><a href="#local-6989586621681050766"><span class="hs-identifier hs-var hs-var">bounds_lo</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe Literal
</span><a href="#local-6989586621681050771"><span class="hs-identifier hs-var">lo_bound</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Literal -&gt; Maybe Literal
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Literal
</span><a href="#local-6989586621681050757"><span class="hs-identifier hs-var">mid_lit</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-545"></span><span>    </span><span id="local-6989586621681050763"><span class="annot"><span class="annottext">bounds_hi :: LitBound
</span><a href="#local-6989586621681050763"><span class="hs-identifier hs-var hs-var">bounds_hi</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Literal -&gt; Maybe Literal
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Literal
</span><a href="#local-6989586621681050757"><span class="hs-identifier hs-var">mid_lit</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Maybe Literal
</span><a href="#local-6989586621681050770"><span class="hs-identifier hs-var">hi_bound</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-546"></span><span>
</span><span id="line-547"></span><span>    </span><span id="local-6989586621681050760"><span class="annot"><span class="annottext">cond :: Platform -&gt; CmmExpr
</span><a href="#local-6989586621681050760"><span class="hs-identifier hs-var hs-var">cond</span></a></span></span><span> </span><span id="local-6989586621681050756"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681050756"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MachOp -&gt; [CmmExpr] -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmMachOp"><span class="hs-identifier hs-var">CmmMachOp</span></a></span><span> </span><span class="annot"><span class="annottext">MachOp
</span><a href="#local-6989586621681050755"><span class="hs-identifier hs-var">lt</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681050773"><span class="hs-identifier hs-var">scrut</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CmmLit -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmLit"><span class="hs-identifier hs-var">CmmLit</span></a></span><span> </span><span class="annot"><span class="annottext">CmmLit
</span><a href="#local-6989586621681050754"><span class="hs-identifier hs-var">cmm_lit</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-548"></span><span>      </span><span class="hs-keyword">where</span><span>
</span><span id="line-549"></span><span>        </span><span id="local-6989586621681050754"><span class="annot"><span class="annottext">cmm_lit :: CmmLit
</span><a href="#local-6989586621681050754"><span class="hs-identifier hs-var hs-var">cmm_lit</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; Literal -&gt; CmmLit
</span><a href="GHC.StgToCmm.Utils.html#mkSimpleLit"><span class="hs-identifier hs-var">mkSimpleLit</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681050756"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">Literal
</span><a href="#local-6989586621681050757"><span class="hs-identifier hs-var">mid_lit</span></a></span><span>
</span><span id="line-550"></span><span>        </span><span id="local-6989586621681050755"><span class="annot"><span class="annottext">lt :: MachOp
</span><a href="#local-6989586621681050755"><span class="hs-identifier hs-var hs-var">lt</span></a></span></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Width -&gt; MachOp
</span><a href="GHC.Cmm.MachOp.html#MO_F_Lt"><span class="hs-identifier hs-var">MO_F_Lt</span></a></span><span> </span><span class="annot"><span class="annottext">Width
</span><a href="#local-6989586621681050774"><span class="hs-identifier hs-var">rep</span></a></span><span>
</span><span id="line-551"></span><span>
</span><span id="line-552"></span><span>
</span><span id="line-553"></span><span class="hs-comment">--------------</span><span>
</span><span id="line-554"></span><span class="annot"><a href="GHC.StgToCmm.Utils.html#label_default"><span class="hs-identifier hs-type">label_default</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.BlockId.html#BlockId"><span class="hs-identifier hs-type">BlockId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Graph.html#CmmAGraphScoped"><span class="hs-identifier hs-type">CmmAGraphScoped</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.BlockId.html#BlockId"><span class="hs-identifier hs-type">BlockId</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-555"></span><span id="label_default"><span class="annot"><span class="annottext">label_default :: BlockId -&gt; Maybe CmmAGraphScoped -&gt; FCode (Maybe BlockId)
</span><a href="GHC.StgToCmm.Utils.html#label_default"><span class="hs-identifier hs-var hs-var">label_default</span></a></span></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Maybe CmmAGraphScoped
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-556"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe BlockId -&gt; FCode (Maybe BlockId)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe BlockId
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-557"></span><span class="annot"><a href="GHC.StgToCmm.Utils.html#label_default"><span class="hs-identifier hs-var">label_default</span></a></span><span> </span><span id="local-6989586621681050752"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681050752"><span class="hs-identifier hs-var">join_lbl</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681050751"><span class="annot"><span class="annottext">CmmAGraphScoped
</span><a href="#local-6989586621681050751"><span class="hs-identifier hs-var">code</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-558"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621681050750"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681050750"><span class="hs-identifier hs-var">lbl</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">BlockId -&gt; CmmAGraphScoped -&gt; FCode BlockId
</span><a href="GHC.StgToCmm.Utils.html#label_code"><span class="hs-identifier hs-var">label_code</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681050752"><span class="hs-identifier hs-var">join_lbl</span></a></span><span> </span><span class="annot"><span class="annottext">CmmAGraphScoped
</span><a href="#local-6989586621681050751"><span class="hs-identifier hs-var">code</span></a></span><span>
</span><span id="line-559"></span><span>       </span><span class="annot"><span class="annottext">Maybe BlockId -&gt; FCode (Maybe BlockId)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BlockId -&gt; Maybe BlockId
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681050750"><span class="hs-identifier hs-var">lbl</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-560"></span><span>
</span><span id="line-561"></span><span class="hs-comment">--------------</span><span>
</span><span id="line-562"></span><span id="local-6989586621681051311"><span class="annot"><a href="GHC.StgToCmm.Utils.html#label_branches"><span class="hs-identifier hs-type">label_branches</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.BlockId.html#BlockId"><span class="hs-identifier hs-type">BlockId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681051311"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.Cmm.Graph.html#CmmAGraphScoped"><span class="hs-identifier hs-type">CmmAGraphScoped</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681051311"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.Cmm.BlockId.html#BlockId"><span class="hs-identifier hs-type">BlockId</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span></span><span>
</span><span id="line-563"></span><span id="label_branches"><span class="annot"><span class="annottext">label_branches :: forall a. BlockId -&gt; [(a, CmmAGraphScoped)] -&gt; FCode [(a, BlockId)]
</span><a href="GHC.StgToCmm.Utils.html#label_branches"><span class="hs-identifier hs-var hs-var">label_branches</span></a></span></span><span> </span><span id="local-6989586621681050745"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681050745"><span class="hs-identifier hs-var">_join_lbl</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-564"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(a, BlockId)] -&gt; FCode [(a, BlockId)]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-565"></span><span class="annot"><a href="GHC.StgToCmm.Utils.html#label_branches"><span class="hs-identifier hs-var">label_branches</span></a></span><span> </span><span id="local-6989586621681050744"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681050744"><span class="hs-identifier hs-var">join_lbl</span></a></span></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span id="local-6989586621681050743"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681050743"><span class="hs-identifier hs-var">tag</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681050742"><span class="annot"><span class="annottext">CmmAGraphScoped
</span><a href="#local-6989586621681050742"><span class="hs-identifier hs-var">code</span></a></span></span><span class="hs-special">)</span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621681050741"><span class="annot"><span class="annottext">[(a, CmmAGraphScoped)]
</span><a href="#local-6989586621681050741"><span class="hs-identifier hs-var">branches</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-566"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621681050740"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681050740"><span class="hs-identifier hs-var">lbl</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">BlockId -&gt; CmmAGraphScoped -&gt; FCode BlockId
</span><a href="GHC.StgToCmm.Utils.html#label_code"><span class="hs-identifier hs-var">label_code</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681050744"><span class="hs-identifier hs-var">join_lbl</span></a></span><span> </span><span class="annot"><span class="annottext">CmmAGraphScoped
</span><a href="#local-6989586621681050742"><span class="hs-identifier hs-var">code</span></a></span><span>
</span><span id="line-567"></span><span>       </span><span id="local-6989586621681050739"><span class="annot"><span class="annottext">[(a, BlockId)]
</span><a href="#local-6989586621681050739"><span class="hs-identifier hs-var">branches'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">BlockId -&gt; [(a, CmmAGraphScoped)] -&gt; FCode [(a, BlockId)]
forall a. BlockId -&gt; [(a, CmmAGraphScoped)] -&gt; FCode [(a, BlockId)]
</span><a href="GHC.StgToCmm.Utils.html#label_branches"><span class="hs-identifier hs-var">label_branches</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681050744"><span class="hs-identifier hs-var">join_lbl</span></a></span><span> </span><span class="annot"><span class="annottext">[(a, CmmAGraphScoped)]
</span><a href="#local-6989586621681050741"><span class="hs-identifier hs-var">branches</span></a></span><span>
</span><span id="line-568"></span><span>       </span><span class="annot"><span class="annottext">[(a, BlockId)] -&gt; FCode [(a, BlockId)]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681050743"><span class="hs-identifier hs-var">tag</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681050740"><span class="hs-identifier hs-var">lbl</span></a></span><span class="hs-special">)</span><span class="annot"><span class="annottext">(a, BlockId) -&gt; [(a, BlockId)] -&gt; [(a, BlockId)]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[(a, BlockId)]
</span><a href="#local-6989586621681050739"><span class="hs-identifier hs-var">branches'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-569"></span><span>
</span><span id="line-570"></span><span class="hs-comment">--------------</span><span>
</span><span id="line-571"></span><span class="annot"><a href="GHC.StgToCmm.Utils.html#label_code"><span class="hs-identifier hs-type">label_code</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.BlockId.html#BlockId"><span class="hs-identifier hs-type">BlockId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Graph.html#CmmAGraphScoped"><span class="hs-identifier hs-type">CmmAGraphScoped</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.BlockId.html#BlockId"><span class="hs-identifier hs-type">BlockId</span></a></span><span>
</span><span id="line-572"></span><span class="hs-comment">--  label_code J code</span><span>
</span><span id="line-573"></span><span class="hs-comment">--      generates</span><span>
</span><span id="line-574"></span><span class="hs-comment">--  [L: code; goto J]</span><span>
</span><span id="line-575"></span><span class="hs-comment">-- and returns L</span><span>
</span><span id="line-576"></span><span id="label_code"><span class="annot"><span class="annottext">label_code :: BlockId -&gt; CmmAGraphScoped -&gt; FCode BlockId
</span><a href="GHC.StgToCmm.Utils.html#label_code"><span class="hs-identifier hs-var hs-var">label_code</span></a></span></span><span> </span><span id="local-6989586621681050738"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681050738"><span class="hs-identifier hs-var">join_lbl</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681050737"><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681050737"><span class="hs-identifier hs-var">code</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681050736"><span class="annot"><span class="annottext">CmmTickScope
</span><a href="#local-6989586621681050736"><span class="hs-identifier hs-var">tsc</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-577"></span><span>    </span><span id="local-6989586621681050735"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681050735"><span class="hs-identifier hs-var">lbl</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode BlockId
forall (m :: * -&gt; *). MonadUnique m =&gt; m BlockId
</span><a href="GHC.Cmm.BlockId.html#newBlockId"><span class="hs-identifier hs-var">newBlockId</span></a></span><span>
</span><span id="line-578"></span><span>    </span><span class="annot"><span class="annottext">BlockId -&gt; CmmAGraphScoped -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#emitOutOfLine"><span class="hs-identifier hs-var">emitOutOfLine</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681050735"><span class="hs-identifier hs-var">lbl</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681050737"><span class="hs-identifier hs-var">code</span></a></span><span> </span><span class="annot"><span class="annottext">CmmAGraph -&gt; CmmAGraph -&gt; CmmAGraph
</span><a href="GHC.Cmm.Graph.html#%3C%2A%3E"><span class="hs-operator hs-var">CmmGraph.&lt;*&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId -&gt; CmmAGraph
</span><a href="GHC.Cmm.Graph.html#mkBranch"><span class="hs-identifier hs-var">mkBranch</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681050738"><span class="hs-identifier hs-var">join_lbl</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CmmTickScope
</span><a href="#local-6989586621681050736"><span class="hs-identifier hs-var">tsc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-579"></span><span>    </span><span class="annot"><span class="annottext">BlockId -&gt; FCode BlockId
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681050735"><span class="hs-identifier hs-var">lbl</span></a></span><span>
</span><span id="line-580"></span><span>
</span><span id="line-581"></span><span class="hs-comment">--------------</span><span>
</span><span id="line-582"></span><span class="annot"><a href="GHC.StgToCmm.Utils.html#assignTemp%27"><span class="hs-identifier hs-type">assignTemp'</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span>
</span><span id="line-583"></span><span id="assignTemp%27"><span class="annot"><span class="annottext">assignTemp' :: CmmExpr -&gt; FCode CmmExpr
</span><a href="GHC.StgToCmm.Utils.html#assignTemp%27"><span class="hs-identifier hs-var hs-var">assignTemp'</span></a></span></span><span> </span><span id="local-6989586621681050732"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681050732"><span class="hs-identifier hs-var">e</span></a></span></span><span>
</span><span id="line-584"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">CmmExpr -&gt; Bool
</span><a href="GHC.Cmm.Utils.html#isTrivialCmmExpr"><span class="hs-identifier hs-var">isTrivialCmmExpr</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681050732"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmExpr -&gt; FCode CmmExpr
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681050732"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-585"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-586"></span><span>       </span><span id="local-6989586621681050730"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681050730"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode Platform
</span><a href="GHC.StgToCmm.Monad.html#getPlatform"><span class="hs-identifier hs-var">getPlatform</span></a></span><span>
</span><span id="line-587"></span><span>       </span><span id="local-6989586621681050729"><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681050729"><span class="hs-identifier hs-var">lreg</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CmmType -&gt; FCode LocalReg
forall (m :: * -&gt; *). MonadUnique m =&gt; CmmType -&gt; m LocalReg
</span><a href="GHC.StgToCmm.Utils.html#newTemp"><span class="hs-identifier hs-var">newTemp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; CmmExpr -&gt; CmmType
</span><a href="GHC.Cmm.Expr.html#cmmExprType"><span class="hs-identifier hs-var">cmmExprType</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681050730"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681050732"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-588"></span><span>       </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681050728"><span class="annot"><span class="annottext">reg :: CmmReg
</span><a href="#local-6989586621681050728"><span class="hs-identifier hs-var hs-var">reg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LocalReg -&gt; CmmReg
</span><a href="GHC.Cmm.Expr.html#CmmLocal"><span class="hs-identifier hs-var">CmmLocal</span></a></span><span> </span><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681050729"><span class="hs-identifier hs-var">lreg</span></a></span><span>
</span><span id="line-589"></span><span>       </span><span class="annot"><span class="annottext">CmmReg -&gt; CmmExpr -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#emitAssign"><span class="hs-identifier hs-var">emitAssign</span></a></span><span> </span><span class="annot"><span class="annottext">CmmReg
</span><a href="#local-6989586621681050728"><span class="hs-identifier hs-var">reg</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681050732"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-590"></span><span>       </span><span class="annot"><span class="annottext">CmmExpr -&gt; FCode CmmExpr
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmReg -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmReg"><span class="hs-identifier hs-var">CmmReg</span></a></span><span> </span><span class="annot"><span class="annottext">CmmReg
</span><a href="#local-6989586621681050728"><span class="hs-identifier hs-var">reg</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-591"></span><span>
</span><span id="line-592"></span><span>
</span><span id="line-593"></span><span class="hs-comment">---------------------------------------------------------------------------</span><span>
</span><span id="line-594"></span><span class="hs-comment">-- Pushing to the update remembered set</span><span>
</span><span id="line-595"></span><span class="hs-comment">---------------------------------------------------------------------------</span><span>
</span><span id="line-596"></span><span>
</span><span id="line-597"></span><span id="local-6989586621681051288"><span class="annot"><a href="GHC.StgToCmm.Utils.html#whenUpdRemSetEnabled"><span class="hs-identifier hs-type">whenUpdRemSetEnabled</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681051288"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span><span>
</span><span id="line-598"></span><span id="whenUpdRemSetEnabled"><span class="annot"><span class="annottext">whenUpdRemSetEnabled :: forall a. FCode a -&gt; FCode ()
</span><a href="GHC.StgToCmm.Utils.html#whenUpdRemSetEnabled"><span class="hs-identifier hs-var hs-var">whenUpdRemSetEnabled</span></a></span></span><span> </span><span id="local-6989586621681050724"><span class="annot"><span class="annottext">FCode a
</span><a href="#local-6989586621681050724"><span class="hs-identifier hs-var">code</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-599"></span><span>    </span><span id="local-6989586621681050723"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681050723"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode Platform
</span><a href="GHC.StgToCmm.Monad.html#getPlatform"><span class="hs-identifier hs-var">getPlatform</span></a></span><span>
</span><span id="line-600"></span><span>    </span><span id="local-6989586621681050722"><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681050722"><span class="hs-identifier hs-var">do_it</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode a -&gt; FCode CmmAGraph
forall a. FCode a -&gt; FCode CmmAGraph
</span><a href="GHC.StgToCmm.Monad.html#getCode"><span class="hs-identifier hs-var">getCode</span></a></span><span> </span><span class="annot"><span class="annottext">FCode a
</span><a href="#local-6989586621681050724"><span class="hs-identifier hs-var">code</span></a></span><span>
</span><span id="line-601"></span><span>    </span><span class="hs-keyword">let</span><span>
</span><span id="line-602"></span><span>      </span><span id="local-6989586621681050720"><span class="annot"><span class="annottext">enabled :: CmmExpr
</span><a href="#local-6989586621681050720"><span class="hs-identifier hs-var hs-var">enabled</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmExpr -&gt; CmmType -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmLoad"><span class="hs-identifier hs-var">CmmLoad</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmLit -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmLit"><span class="hs-identifier hs-var">CmmLit</span></a></span><span> </span><span class="annot"><span class="annottext">(CmmLit -&gt; CmmExpr) -&gt; CmmLit -&gt; CmmExpr
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel -&gt; CmmLit
</span><a href="GHC.Cmm.Expr.html#CmmLabel"><span class="hs-identifier hs-var">CmmLabel</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="GHC.Cmm.CLabel.html#mkNonmovingWriteBarrierEnabledLabel"><span class="hs-identifier hs-var">mkNonmovingWriteBarrierEnabledLabel</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; CmmType
</span><a href="GHC.Cmm.Type.html#bWord"><span class="hs-identifier hs-var">bWord</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681050723"><span class="hs-identifier hs-var">platform</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-603"></span><span>      </span><span id="local-6989586621681050718"><span class="annot"><span class="annottext">zero :: CmmExpr
</span><a href="#local-6989586621681050718"><span class="hs-identifier hs-var hs-var">zero</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; CmmExpr
</span><a href="GHC.Cmm.Utils.html#zeroExpr"><span class="hs-identifier hs-var">zeroExpr</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681050723"><span class="hs-identifier hs-var">platform</span></a></span><span>
</span><span id="line-604"></span><span>      </span><span id="local-6989586621681050716"><span class="annot"><span class="annottext">is_enabled :: CmmExpr
</span><a href="#local-6989586621681050716"><span class="hs-identifier hs-var hs-var">is_enabled</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; CmmExpr -&gt; CmmExpr -&gt; CmmExpr
</span><a href="GHC.Cmm.Utils.html#cmmNeWord"><span class="hs-identifier hs-var">cmmNeWord</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681050723"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681050720"><span class="hs-identifier hs-var">enabled</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681050718"><span class="hs-identifier hs-var">zero</span></a></span><span>
</span><span id="line-605"></span><span>    </span><span id="local-6989586621681050715"><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681050715"><span class="hs-identifier hs-var">the_if</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CmmExpr -&gt; CmmAGraph -&gt; CmmAGraph -&gt; Maybe Bool -&gt; FCode CmmAGraph
</span><a href="GHC.StgToCmm.Monad.html#mkCmmIfThenElse%27"><span class="hs-identifier hs-var">mkCmmIfThenElse'</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681050716"><span class="hs-identifier hs-var">is_enabled</span></a></span><span> </span><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681050722"><span class="hs-identifier hs-var">do_it</span></a></span><span> </span><span class="annot"><span class="annottext">CmmAGraph
</span><a href="GHC.Cmm.Graph.html#mkNop"><span class="hs-identifier hs-var">mkNop</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; Maybe Bool
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span class="hs-special">)</span><span>
</span><span id="line-606"></span><span>    </span><span class="annot"><span class="annottext">CmmAGraph -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#emit"><span class="hs-identifier hs-var">emit</span></a></span><span> </span><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681050715"><span class="hs-identifier hs-var">the_if</span></a></span><span>
</span><span id="line-607"></span><span>
</span><span id="line-608"></span><span class="hs-comment">-- | Emit code to add an entry to a now-overwritten pointer to the update</span><span>
</span><span id="line-609"></span><span class="hs-comment">-- remembered set.</span><span>
</span><span id="line-610"></span><span class="annot"><a href="GHC.StgToCmm.Utils.html#emitUpdRemSetPush"><span class="hs-identifier hs-type">emitUpdRemSetPush</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span>   </span><span class="hs-comment">-- ^ value of pointer which was overwritten</span><span>
</span><span id="line-611"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-612"></span><span id="emitUpdRemSetPush"><span class="annot"><span class="annottext">emitUpdRemSetPush :: CmmExpr -&gt; FCode ()
</span><a href="GHC.StgToCmm.Utils.html#emitUpdRemSetPush"><span class="hs-identifier hs-var hs-var">emitUpdRemSetPush</span></a></span></span><span> </span><span id="local-6989586621681050712"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681050712"><span class="hs-identifier hs-var">ptr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-613"></span><span>    </span><span class="annot"><span class="annottext">UnitId
-&gt; FastString -&gt; [(CmmExpr, ForeignHint)] -&gt; Bool -&gt; FCode ()
</span><a href="GHC.StgToCmm.Utils.html#emitRtsCall"><span class="hs-identifier hs-var">emitRtsCall</span></a></span><span>
</span><span id="line-614"></span><span>      </span><span class="annot"><span class="annottext">UnitId
</span><a href="GHC.Unit.Types.html#rtsUnitId"><span class="hs-identifier hs-var">rtsUnitId</span></a></span><span>
</span><span id="line-615"></span><span>      </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; FastString
</span><a href="GHC.Data.FastString.html#fsLit"><span class="hs-identifier hs-var">fsLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;updateRemembSetPushClosure_&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-616"></span><span>      </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmReg -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmReg"><span class="hs-identifier hs-var">CmmReg</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GlobalReg -&gt; CmmReg
</span><a href="GHC.Cmm.Expr.html#CmmGlobal"><span class="hs-identifier hs-var">CmmGlobal</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalReg
</span><a href="GHC.Cmm.Expr.html#BaseReg"><span class="hs-identifier hs-var">BaseReg</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ForeignHint
</span><a href="GHC.Cmm.Type.html#AddrHint"><span class="hs-identifier hs-var">AddrHint</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-617"></span><span>       </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681050712"><span class="hs-identifier hs-var">ptr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ForeignHint
</span><a href="GHC.Cmm.Type.html#AddrHint"><span class="hs-identifier hs-var">AddrHint</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-618"></span><span>      </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-619"></span><span>
</span><span id="line-620"></span><span class="annot"><a href="GHC.StgToCmm.Utils.html#emitUpdRemSetPushThunk"><span class="hs-identifier hs-type">emitUpdRemSetPushThunk</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span> </span><span class="hs-comment">-- ^ the thunk</span><span>
</span><span id="line-621"></span><span>                       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-622"></span><span id="emitUpdRemSetPushThunk"><span class="annot"><span class="annottext">emitUpdRemSetPushThunk :: CmmExpr -&gt; FCode ()
</span><a href="GHC.StgToCmm.Utils.html#emitUpdRemSetPushThunk"><span class="hs-identifier hs-var hs-var">emitUpdRemSetPushThunk</span></a></span></span><span> </span><span id="local-6989586621681050708"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681050708"><span class="hs-identifier hs-var">ptr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-623"></span><span>    </span><span class="annot"><span class="annottext">UnitId
-&gt; FastString -&gt; [(CmmExpr, ForeignHint)] -&gt; Bool -&gt; FCode ()
</span><a href="GHC.StgToCmm.Utils.html#emitRtsCall"><span class="hs-identifier hs-var">emitRtsCall</span></a></span><span>
</span><span id="line-624"></span><span>      </span><span class="annot"><span class="annottext">UnitId
</span><a href="GHC.Unit.Types.html#rtsUnitId"><span class="hs-identifier hs-var">rtsUnitId</span></a></span><span>
</span><span id="line-625"></span><span>      </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; FastString
</span><a href="GHC.Data.FastString.html#fsLit"><span class="hs-identifier hs-var">fsLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;updateRemembSetPushThunk_&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-626"></span><span>      </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmReg -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmReg"><span class="hs-identifier hs-var">CmmReg</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GlobalReg -&gt; CmmReg
</span><a href="GHC.Cmm.Expr.html#CmmGlobal"><span class="hs-identifier hs-var">CmmGlobal</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalReg
</span><a href="GHC.Cmm.Expr.html#BaseReg"><span class="hs-identifier hs-var">BaseReg</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ForeignHint
</span><a href="GHC.Cmm.Type.html#AddrHint"><span class="hs-identifier hs-var">AddrHint</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-627"></span><span>       </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681050708"><span class="hs-identifier hs-var">ptr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ForeignHint
</span><a href="GHC.Cmm.Type.html#AddrHint"><span class="hs-identifier hs-var">AddrHint</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-628"></span><span>      </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-629"></span></pre></body></html>